-
Notifications
You must be signed in to change notification settings - Fork 75
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
extend and improve the permission system #54
Comments
I'm willing to work on this issue if you don't mind. What's your idea about the implementation specifics? Something along these lines?
What about allowing for finer-grained permission control over commands instead of preset permissions? This would be messier, although more powerful for users. Perhaps permission groups (like |
The bullet points sound spot on, but I'm not following the finer-grained permission control proposal. Could you elaborate a bit more on what that would look like and how it would work? Also, thanks for taking interest in this one. :) |
You're welcome! I'm glad to contribute. In fact you should expect me getting involved in more issues sooner :P After a bit of thought this idea for finer-grained permissions came to my mind. Plugin-set permissions could still rely on namespace-qualified keywords, but command-based finer-grained permissions can be set referencing the commands themselves. Mockup syntax: ;; These let bindings could be considered as permission groups, to avoid polluting users with lots of complex permissions
(let [voicer-perms #{'operator/voice 'operator/devoice} ; Per-command permissions (note these are not keywords)
admin-perms (into #{:lazybot/admin, ; Global permission
'operator}, ; Namespace/plugin-wide permission
voicer-perms)] ; group composition
{...
:default-perms [:github/list-commits] ; Perms for all users (including :user)
:users {"Jen" {:pass "123", :perms admin-perms}
"Jack" {:pass "456", :perms voicer-perms}}
...} The ugly thing with command-permissions is, either:
And there's a problem: commands ARE NOT fns, so some heavy magic with symbols might be involved. This is the cleanest syntax I could come up with. This Gist features the first alternative that came off the top of my head, but it's rather complex and I'm not sure I like it. It's probably wise to stick with the simple plugin-set permissions, but I think that per-command permissions is a legitimate (although quite complex) use case (e.g. the operator-but-only-voice-group could be useful for some people.) |
Right now, all we can do with the permission system is declare users to be either admin or regular user. We need to expand this out and improve it so that we can have an extensible system capable of very specific permissions. This way we can have sets of permissions for users that plugins can add to and check for as well as two basic permissions:
The idea is that it would be possible to give certain non-admin users more dangerous and specialized permissions. For example, a plugin foo could check for its own special permission, like permission
foo
.The text was updated successfully, but these errors were encountered: