Jump to content

Database Error


sanyisasha

Recommended Posts

Posted

Hi.

Why i get this error?

Quote

Access denied @ 'fileRename' [Database credentials protection denied resource <resource1> to access <resource2>]
Resource1: the resource what want to use fileRename
Resource2: the target resource where the rename happens

I want to make a class named Database, what in construct do dbConnect.
The resource1 is copy this class, but first rename meta.xml to meta.old.xml, and that's where the problem happens.
I tryed exporting the dbConnect value, same error.
I found out the dbConnect and it's value throw this error. But why i can't rename?

Thanks for help,
SaSha

Posted

So you want to take the connection to other resource as understand why not do this and add expprt in meta and done 

function connectionToMySQL() 
  connection = dbConnect() 
end
addEventHandler("onResourceStart", resourceRoot, connectionToMySQL) 


function getConnection
  return connection 
end 

 

Posted

As i said, already tryed. 

I think the real problem is i want to modify a meta. Xml where is an active db connection. Maybe i should try disconnect/destroy befor do it. 

Posted

You have to give the resource calling fileRename access to ModifyOtherObjects or something like that, look for it in your ACL.xml and you'll find it.

Posted
17 minutes ago, MIKI785 said:

You have to give the resource calling fileRename access to ModifyOtherObjects or something like that, look for it in your ACL.xml and you'll find it.

Read again the problem. The script is working, only with database occoure the error

Posted

You're saying that youre not able to rename a file and you get an error saying 'Access denied', isnt that an ACL issue? Does the resource have access to it?

Posted
9 minutes ago, MIKI785 said:

You're saying that youre not able to rename a file and you get an error saying 'Access denied', isnt that an ACL issue? Does the resource have access to it?

Its only happens when trying to rename resource's meta with database class in it. Read the full error message, not common access denied

Posted
11 minutes ago, Dimos7 said:

when export the function you put in meta that


<export function ="name of your function here" type="server"/>

 

I'm not stuppid. And the problem is not can't call global getHandler

  • Discord Moderators
Posted (edited)
Quote

Warning: As of 1.5.4 r10413, this function will fail when trying to access a script file of another resource, even with general.ModifyOtherObjects rights granted, which uses a mysql connection through dbConnect when database_credentials_protection is enabled in the server configuration. Additionally, meta.xml will be un-writable and will always open in read-only mode.

Copied from fileOpen's wiki page.

Edited by Pirulax
  • Thanks 1
Posted
7 minutes ago, Pirulax said:

Copied from fileOpen's wiki page.

Hmmm.. Just one word: :O YOU (not you, i mean mta, and yeah, it's two word).
Thanks Pirulax, i search only in fileRename.

Solution: <right name="general.ModifyOtherObjects.packages" access="true" />

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...