-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
For bot-as-service usability is needed prefered privileges defined by admin in config file or storage.
Scenario:
- User handle a command
- ACL looks for prefered privilege.
- User has preferred privilege DENIED => gone, can't do it
- User has preferred privilege ALLOWED => okay, do it!
- User has preferred privilege NONE => continue authorization process
- ACL looks for permisions
- Allowed? Do it!
- Not allowed? Don't it!
Function for resolve preferred privileges returns one of states:
- ALLOWED
- DENIED
- NONE
Special privileges can be specified in configuration file:
---
privileges:
cmd.alias:
- allow: yes
entity: user
userID: '12345698745632104561357'
channelID: null
- allow: yes
entity: role
roleID: '96325874109874563213304'
- allow: no
entity: everyone
cmd.armageddon:
- allow: yes
entity: guildOwner
- allow: no
entity: everyone
cmd.ping:
- allow: yes
entity: everyone
cmd.say:
- allow: yes
entity: botAdmin
- allow: no
- entity: everyone
Privilege entities:
user
- Restrict permission for specified user (and on specified channel)role
- Restrict for permission for specified role (and on specified channel)everyone
- Restrict permission for everyone (and on specified channel)guildOwner
- Restrict permission for guild ownerbotAdmin
- Restrict permission for bot administrator
if allow
is true, then permission is ALLOWED, if it's false, permission is DENIED. If not defined resource or not specified privilege entity, then permission is NONE.