sanyisasha Posted October 3, 2018 Share Posted October 3, 2018 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 fileRenameResource2: 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 Link to comment
Dimos7 Posted October 3, 2018 Share Posted October 3, 2018 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 Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 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. Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 20 minutes ago, Dimos7 said: Can you show the meta Wich one? Link to comment
MIKI785 Posted October 4, 2018 Share Posted October 4, 2018 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. Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 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 Link to comment
MIKI785 Posted October 4, 2018 Share Posted October 4, 2018 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? Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 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 Link to comment
Dimos7 Posted October 4, 2018 Share Posted October 4, 2018 when export the function you put in meta that <export function ="name of your function here" type="server"/> Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 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 Link to comment
Discord Moderators Pirulax Posted October 4, 2018 Discord Moderators Share Posted October 4, 2018 (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 October 4, 2018 by Pirulax 1 Link to comment
sanyisasha Posted October 4, 2018 Author Share Posted October 4, 2018 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" /> Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now