Skip to content
New issue

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

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

Already on GitHub? # to your account

New permission system #62

Open
ylt opened this issue Aug 7, 2015 · 0 comments
Open

New permission system #62

ylt opened this issue Aug 7, 2015 · 0 comments

Comments

@ylt
Copy link
Member

ylt commented Aug 7, 2015

Current system isn't particularly clean and isn't very flexible, Go with a nodes approach.

Nodes can be defined in a form like: [plugin].[command](more dots also if needed)

So, i.e.

"groups.manager": [
  "groups.bouncer",
  "-basicbot.banall"
  "basicbot.*"
]

"groups.bouncer": [
  "groups.normal",
  "playlist.add",
  "playlist.grab",
  "playlist.activate",
  "basicbot.add",
]

"groups.residentdj": [
  "groups.normal",
  "basicbot.add.self"
]

"groups.normal": [
  "wolfram.search",
  "afk.afk",
]

Users will automatically have the node for their current group, it will also be possible to specify additional nodes for specific users such as:

"users.ylt": [
  "*"
]

These can then be checked via either a function, or via an annotation.

@Command("ban", {permission: "basicbot.ban"})
ban(messageData) {
    //will only reach here if user has the permission :)
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant