Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefered privileges #132

Open
purrplingcat opened this issue Oct 27, 2017 · 0 comments
Open

Prefered privileges #132

purrplingcat opened this issue Oct 27, 2017 · 0 comments

Comments

@purrplingcat
Copy link
Owner

purrplingcat commented Oct 27, 2017

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 owner
  • botAdmin - 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant