]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added testcases about adding and removing users to groups using subadmins
authorSergio Bertolin <sbertolin@solidgear.es>
Tue, 16 Aug 2016 09:01:29 +0000 (09:01 +0000)
committerSergio Bertolín <sbertolin@solidgear.es>
Fri, 26 Aug 2016 13:08:48 +0000 (13:08 +0000)
Conflicts:
build/integration/features/provisioning-v1.feature

build/integration/features/provisioning-v1.feature

index 625d24260de7357025b89879d036401facad78ce..26e466118d34b354707af731014c84f52291c511 100644 (file)
@@ -316,6 +316,65 @@ Feature: provisioning
                And the HTTP status code should be "200"
                And app "files_external" is disabled
 
+       Scenario: a subadmin can add users to groups the subadmin is responsible for
+               Given As an "admin"
+               And user "subadmin" exists
+               And user "brand-new-user" exists
+               And group "new-group" exists
+               And Assure user "subadmin" is subadmin of group "new-group"
+               And As an "subadmin"
+               When sending "POST" to "/cloud/users/brand-new-user/groups" with
+                       | groupid | new-group |
+               Then the OCS status code should be "100"
+               And the HTTP status code should be "200"
+               And user "brand-new-user" belongs to group "new-group"
+
+       Scenario: a subadmin cannot add users to groups the subadmin is not responsible for
+               Given As an "admin"
+               And user "other-subadmin" exists
+               And user "brand-new-user" exists
+               And group "new-group" exists
+               And group "other-group" exists
+               And Assure user "other-subadmin" is subadmin of group "other-group"
+               And As an "other-subadmin"
+               When sending "POST" to "/cloud/users/brand-new-user/groups" with
+                       | groupid | new-group |
+               Then the OCS status code should be "104"
+               And the HTTP status code should be "200"
+               And As an "admin"
+               And user "brand-new-user" does not belongs to group "new-group"
+
+       Scenario: a subadmin can remove users to groups the subadmin is responsible for
+               Given As an "admin"
+               And user "subadmin" exists
+               And user "brand-new-user" exists
+               And group "new-group" exists
+               And user "brand-new-user" belongs to group "new-group"
+               And Assure user "subadmin" is subadmin of group "new-group"
+               And As an "subadmin"
+               When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
+                       | groupid | new-group |
+               Then the OCS status code should be "100"
+               And the HTTP status code should be "200"
+               And As an "admin"
+               And user "brand-new-user" does not belong to group "new-group"
+
+       Scenario: a subadmin cannot remove users to groups the subadmin is not responsible for
+               Given As an "admin"
+               And user "other-subadmin" exists
+               And user "brand-new-user" exists
+               And group "new-group" exists
+               And group "other-group" exists
+               And user "brand-new-user" belongs to group "new-group"
+               And Assure user "other-subadmin" is subadmin of group "other-group"
+               And As an "other-subadmin"
+               When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
+                       | groupid | new-group |
+               Then the OCS status code should be "104"
+               And the HTTP status code should be "200"
+               And As an "admin"
+               And user "brand-new-user" belongs to group "new-group"
+
        Scenario: Making a web request with an enabled user
            Given As an "admin"
                And user "user0" exists