@@ -484,11 +484,26 @@ Feature: provisioning
484484 Given As an "admin"
485485 And user "brand-new-user" exists
486486 And group "new-group" exists
487+ And group "other-group" exists
487488 When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
488489 | groupid | new -group |
489490 Then the OCS status code should be "100"
490491 And the HTTP status code should be "200"
491492
493+ # Ensure self promotion is not possible
494+ Given As an "brand-new-user"
495+ When sending "POST" to "/cloud/users/brand-new-user/groups" with
496+ | groupid | admin |
497+ Then the OCS status code should be "104"
498+ And the HTTP status code should be "200"
499+
500+ # Ensure self adding to other groups is not possible
501+ Given As an "brand-new-user"
502+ When sending "POST" to "/cloud/users/brand-new-user/groups" with
503+ | groupid | other -group |
504+ Then the OCS status code should be "104"
505+ And the HTTP status code should be "200"
506+
492507 Scenario : get users using a subadmin
493508 Given As an "admin"
494509 And user "brand-new-user" exists
@@ -790,7 +805,7 @@ Feature: provisioning
790805 Then the HTTP status code should be "200"
791806 And user "subadmin" is disabled
792807
793- Scenario : Admin user cannot disable himself
808+ Scenario : Admin user cannot disable themself
794809 Given As an "admin"
795810 And user "another-admin" exists
796811 And user "another-admin" belongs to group "admin"
@@ -801,7 +816,7 @@ Feature: provisioning
801816 And As an "admin"
802817 And user "another-admin" is enabled
803818
804- Scenario :Admin user cannot enable himself
819+ Scenario : Admin user cannot enable themself
805820 Given As an "admin"
806821 And user "another-admin" exists
807822 And user "another-admin" belongs to group "admin"
@@ -834,7 +849,7 @@ Feature: provisioning
834849 And As an "admin"
835850 And user "user2" is disabled
836851
837- Scenario : Subadmin should not be able to disable himself
852+ Scenario : Subadmin should not be able to disable themself
838853 Given As an "admin"
839854 And user "subadmin" exists
840855 And group "new-group" exists
@@ -847,7 +862,7 @@ Feature: provisioning
847862 And As an "admin"
848863 And user "subadmin" is enabled
849864
850- Scenario : Subadmin should not be able to enable himself
865+ Scenario : Subadmin should not be able to enable themself
851866 Given As an "admin"
852867 And user "subadmin" exists
853868 And group "new-group" exists
0 commit comments