multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

ACL improvement #1642

Open ds1-e opened 4 years ago

ds1-e commented 4 years ago

Is your feature request related to a problem? Please describe. Currently, there's no way to disable/enable all rights at once. I'd like to have it since it would be very handy.

Describe the solution you'd like Pretty simple and effective. Allow * to select everything.

<right name="*.*" access="false"/>

/

<right name="command.*" access="true"/>

Describe alternatives you've considered None.

Additional context /

Dark-Dragon commented 4 years ago

While it's certainly handy when used responsibly, I think it's important to also consider if this might end up giving an incentive to use the acl poorly/lazily, basically the "just give it admin rights"-problem. How many entries would a server owner realistically want to have access to everything or nothing?

ds1-e commented 4 years ago

@Dark-Dragon even wiki states that with great power comes great responsibility. It is server owner task to configure it correctly, and i've been taught one thing, if you don't know how to deal with it, just don't do it. Laziness - that's the other case, on my place i'd be up to ask myself: "If i'm that lazy that i couldn't read one wiki page, and understood that it should be used with caution, then why i even bother to manage a server."

qaisjp commented 4 years ago

I'd like to have it since it would be very handy.

Please can you elaborate your use case?

ds1-e commented 4 years ago

I'm going to partially abandon using ACL.xml as a permission system (and in-game account system) for custom perms & account provided by my script. And disable/enable rights by using *. Yes, i know that i could simply copy all entries, and using replace function change access. But, since we have possibility to select all logins/resources by using it, then i thought why not to add it for rights. That might be nice aswell in case of non-standard commands added by other scripts (not really my case, because i'm doing stuff all by myself).

ds1-e commented 3 years ago

@ArranTuna why would you close this?

ArranTuna commented 3 years ago

You never stated what this was needed for.

And "Default" ACL already denies access to every default command / function, and "Admin" grants access to everything.

ds1-e commented 3 years ago

You never stated what this was needed for.

@ArranTuna What about post above?

For better management of ACL.xml which would allow to enable/disable rights by using * (for example all commands, all functions etc.) Along with non-standard rights. This would be useful when editing & creating custom ACL groups, because not everyone use standard configuration.

ArranTuna commented 3 years ago

If you're adding a new command you just add a check in it: hasObjectPermissionTo(player, "command.whatever", false) which will only return true if aclSetRight(theACL, "command.whatever", true) has been used.