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

Add user permission levels #20

Open
OldStarchy opened this issue Apr 5, 2020 · 2 comments
Open

Add user permission levels #20

OldStarchy opened this issue Apr 5, 2020 · 2 comments
Labels
enhancement New feature or request technical debt Hacky code should be replaced with non-hacky code

Comments

@OldStarchy
Copy link
Owner

Not all users should be able to do all the things. At the very least, DashBot should respect server admin roles.

This was referenced Apr 5, 2020
@OldStarchy OldStarchy added the enhancement New feature or request label Apr 5, 2020
@OldStarchy OldStarchy added the technical debt Hacky code should be replaced with non-hacky code label Apr 21, 2021
@OldStarchy
Copy link
Owner Author

A permission is a string (eg. 'command.echoRaw') that is either set, or not set, for a user, server, and user-server combo. Having a permission set grants that permission for the user on the given server.

Eg. on one discord server a user might have permission to view all reminders, but not on another. (does this make sense?) It would depend on the permission as to what its scope should be.

Commands can provide their own permissions, I guess in the format of command.<commandName>, or rely on other permissions (eg. admin).

Since identities are already associated with servers (this might be in the identities branch), an interface like user.hasPermission('ADMIN') or user.hasPermission('command.echoRaw') should be adequate.

@OldStarchy
Copy link
Owner Author

Server permissions can be used to flag server abilities, eg. a minecraft might provide the server.minecraft permission, which would be required for the !fish command. It feels like a hack but the way permissions work would suit this pretty well.

This would mean that there are static and dynamic permissions. Static as in a server type provides a particular permission, and dynamic as in, one that is explicitly granted to a user (or server).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical debt Hacky code should be replaced with non-hacky code
Projects
None yet
Development

No branches or pull requests

1 participant