-
Notifications
You must be signed in to change notification settings - Fork 2
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 contextual permissions to limit users access to certain channels #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little change in the code :)
Please update the readme to reflect the change.
@@ -90,6 +91,10 @@ public void defaultCommand(AurionChatPlayer aurionChatPlayer){ | |||
|
|||
public boolean execute(AurionChatPlayer aurionChatPlayer, String channel, Action action) { | |||
try { | |||
String perm = "aurionchat.channel." + action.name().toLowerCase() + "." + channel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be better to rewrite the function checkChannelExist
and launch this function directly here and remove the usage in the "sub function" leave/join/spy to directly if the channel exist and the player permission
In this project i don't centralize even futher the command in the common so there is a little bit of work in forge and fabric since the command suggest all the channel (tab completion)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, consistent tab completion was not really in my priorities here for the moment.
I'm afraid I'm not quite sure what you mean though; the checkChannelExists
call always precedes this code; so its never skipped nor is there false-positive error messages. Am I missing something?
I made the change, maybe i was confusing when explaining :D. I just change the permission for alllisten to Edit: for now i don't handle the tab completion but i need to rewrite part of the code to have something better to handle this for all platform. I have already made this kind of work in other project :) |
This PR adds per-command-and-channel permissions for most commands, so that through permission management plugins, Administrators can limit access for users to certain channels; such as staff channels.