Skip to content

Added new commands: addrolemember and removerolemember #9

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nagai-takayuki
Copy link

I added two new commands: addrolemember and removerolemember.

  • addrolemember {role} to {idnumber1} {idnumber2} ... {idnumberN}
    add members with the specified role to groups with the specified idnumbers. Group idnumbers are assigned in group config.
  • removerolemember {role} from {idnumber1} {idnumber2} ... {idnumberN}
    remove members with the specified role from groups with the specified idnumbers. Group idnumbers are assigned in group config.

In my use case, I use Moodle course as a kind of peer review system. With these commands, users with special roles (ex. editors, reviewers) are temporary assigned to specific groups according to editorial workflow.

@timhunt
Copy link
Member

timhunt commented Aug 5, 2021

Thank you very much for working on this. This looks like a useful addition.

I am just wondering if we can improve the wording of the command to make it more obvious what it does? (It is very difficult to think of something which is clear.) What about?

groupsadd <role> to <idnumber1>, ...
groupsremove <role> from <idnumber1>, ...

Two other comments:

  • It would be good to have unit tests to very the new code. (There are unit tests for the other commands.)
  • I think the file classes/.command_removerolemember.php.swp should not be included in the comment.

Thanks again.

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

Successfully merging this pull request may close these issues.

2 participants