Name |
Remove User from Group |
Description |
As a PI of a research group, I want to be able to remove an existing user from an existing group so that the user loses his privileges provided by the group. |
Acceptance Criteria |
|
1. |
* The PI or the person who will invoke the removal of the User from the Group needs to have a special certificate. This certificate is provided by the Stewards of the OSC-IS network. |
2. |
* When the PI invokes this functionality, the chaincode should look for her certificate. If said certificate doesn't exist, the PI can't remove the User. If the certificate exists, it should have an attribute called "OU", with the "admin" value. If that is the case, the PI can continue with the removal of the user from a group. If not, an error message should be shown saying that the PI doesn't have enough privileges. |
3. |
* Then, the chaincode needs to verify that the peer the PI is using matches the user's organization. |
4. |
* The PI needs to use a "TransientMap" to pass arguments to this functionality. |
5. |
* The PI needs to pass as arguments the following: Group Id (GID = OrgName.ProjectName.Group.Name)and APIUserID. The incoming transient map must have the form: {"GID": "UCSD.Nanomagnetism.Admin", "APIUserID": "[email protected]"}. |
6. |
* The cc needs to verify that the user already exists. If the user doesn't exist yet, it should show an error stating that. |
7. |
* The cc needs to verify that the group also exists. If the group doesn't exist, the cc must show an error. |
8. |
* The cc needs to verify if the group in the arguments list already has the user. If the group doesn't have the user, the cc should show a message stating that the user was already removed from the group, and the program should continue. |
9. |
* The cc needs to verify if the user has the GID in its Group list attribute. If the group's id is not in that list, the cc should show a message stating that the group was already removed from the user's group list, and the program should continue executing. |
10. |
* If the Group has the User, the Group struct needs to be pulled out from the PDC and updated, and resubmitted to the PDC with the user removed from the users list of that group. |
11. |
* If the User has the Group, the User struct needs to be pulled out from the PDC and updated, and resubmitted to the PDC with the group id removed from the groups list of that User. |
12. |
The associated project must also update its group list and be resubmitted to the PDC. If the project can't be updated and resubmitted, the cc should show an error. |
13. |
If the program finalizes the execution with no error, it should throw a 'nil' error, and a message saying that the User struct, the Project struct and the Group struct were updated. |