I have been learning to code in lua for the past few months. I have read through most of the server and scripting posts and have found lots of help in solving scripting problems.
However, I recently ran into a problem accessing certain functions, like kickPlayer. I have modified the admin acl, adding permissions for each function, and I am a member of the admin group. My script is admin use only, and most functions are wrapped in “hasObjectPermissionTo” if statements, which default to false if the permission is not explicitly granted. Although I can kick from the server control panel and the chatwindow, whenever I tried to access function.kickPlayer, I would get an “access denied” error from the server.
In a recent post someone suggested adding the script resource into the admin group, which would grant the script permission to use kickPlayer and other functions. It worked but I have a few questions:
1. Is adding my script to the admin group a secure and appropriate way to resolve the problem, or is there a better way?
2. Is it a good idea to add a large collection of permissions to the admin group, or should I move all these permissions to a custom list instead?
3. As well as granting these permissions in the admin group, I’ve denied them in all other acl’s. Is setting these functions to false in the other acl’s unnecessary overkill?
4. I use a gui to control the script and while testing noticed that I could access the gui before logging into the server. I’d like the gui to be inaccessible until I’m logged in, as the admin panel is but I can’t figure out how to do this. Any suggestions?
If anyone can suggest where I can find a comprehensive write up on acl’s that would be great. It would be even better if it’s MTASA specific.
Thanks and any help with the above would be appreciated.
Question
shrike
Hello
I have been learning to code in lua for the past few months. I have read through most of the server and scripting posts and have found lots of help in solving scripting problems.
However, I recently ran into a problem accessing certain functions, like kickPlayer. I have modified the admin acl, adding permissions for each function, and I am a member of the admin group. My script is admin use only, and most functions are wrapped in “hasObjectPermissionTo” if statements, which default to false if the permission is not explicitly granted. Although I can kick from the server control panel and the chatwindow, whenever I tried to access function.kickPlayer, I would get an “access denied” error from the server.
In a recent post someone suggested adding the script resource into the admin group, which would grant the script permission to use kickPlayer and other functions. It worked but I have a few questions:
1. Is adding my script to the admin group a secure and appropriate way to resolve the problem, or is there a better way?
2. Is it a good idea to add a large collection of permissions to the admin group, or should I move all these permissions to a custom list instead?
3. As well as granting these permissions in the admin group, I’ve denied them in all other acl’s. Is setting these functions to false in the other acl’s unnecessary overkill?
4. I use a gui to control the script and while testing noticed that I could access the gui before logging into the server. I’d like the gui to be inaccessible until I’m logged in, as the admin panel is but I can’t figure out how to do this. Any suggestions?
If anyone can suggest where I can find a comprehensive write up on acl’s that would be great. It would be even better if it’s MTASA specific.
Thanks and any help with the above would be appreciated.
Link to comment
2 answers to this question
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