Authorization FAQ
From EventScripts Community Encyclopedia
|
[edit] General Questions[edit] What's this AuthorizationService thing I hear about in EventScripts 1.5?It's a handy little interface for scripts to check whether players are allowed to do things. Advanced scripters can code their own authorization back-end that all scripts on your server use. [edit] What? Are you telling me EventScripts supports "admins" now?Yep, pretty much. It's extremely customizable. [edit] How can I use it on my server?To use it on your server: [edit] What is an AuthorizationService provider script?A provider script just manages your admin list. You can only have one loaded at a time. [edit] How do I find an AuthorizationService provider script?As of the release of EventScripts 1.5, there are two example AuthorizationService providers that come with EventScripts: [edit] How do I set permissions for my players?There will be detailed instructions with the auth provider you choose for installation and for adding admins. All providers will be a little different (which is the point), but there will be clear instructions provided with the script. [edit] How do I find scripts that use this?It's highly recommended that scripts make active use of this new feature, so you should see a lot of them coming soon. [edit] Why is the AuthorizationService concept so cool?Well, two major benefits: [edit] Scripter Questions[edit] I'm a scripter-- how do I make say/client commands that use auth?It's easy. Instead of using es_regsaycmd like this:es_regsaycmd mega_ban "myscript/myblock" description [edit] So I just replace a single line in my script for my commands, and I support auth?Yes and yes. Regardless of what backend the server uses, your commands will only run for players who have the permissions you state. [edit] You said "ban_user" above? How did you chose that?It's just a generic name for the permission that you think sounds right. I typically prefer verb_noun syntax based on what the command actually does. Some other examples might be "view_stats", "reset_stats", "kick_user", "gg_give_level", etc. Admins will sometimes use this permission name so that they can grant/deny access to your commands (assuming their auth provider supports that level of control). [edit] What does #admin mean above? Are there other options?The #admin part is just the recommended level for the permission you choose. The back-end can completely ignore it, but you can provide it some guidance if it's never heard of your permission name before. In other words, by default, the script recommends that only admins can "mega_ban". If the admin has configured things differently, that will be ignored, but it's a nice hint to the auth-provider. [edit] Do I need to code my own auth provider?Most scripters won't ever write an auth provider. Their scripts will simply use whatever provider the server has installed. (For example, the admin may load the example group_auth.) Still, if you wanted to code your own auth provider because you have a cool idea for how to store admin lists, see the Advanced Scripter section below. [edit] Advanced Scripter Questions[edit] How do I create an auth provider?The basic idea is to have something implement the AuthorizationService interface and register it as the auth service. See the no_auth, basic_auth, or group_auth examples provided with EventScripts for details on how to do that. More details soon. |
|
