]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1237161: Allow users with bless permissions to update users group membership...
authorMatt Tyson <mtyson@redhat.com>
Sun, 7 Feb 2016 12:43:35 +0000 (13:43 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 7 Feb 2016 12:43:35 +0000 (13:43 +0100)
r=LpSolit a=dkl

Bugzilla/API/1_0/Resource/User.pm
Bugzilla/WebService/User.pm
docs/en/rst/api/core/v1/user.rst

index 3f1b6272d51ab227813a08b81d5cba4002591b06..ec81cf66d39c9032081cdad0d2037bfe26991972 100644 (file)
@@ -326,6 +326,7 @@ sub update {
 
     # Reject access if there is no sense in continuing.
     $user->in_group('editusers')
+        || $user->can_bless()
         || ThrowUserError("auth_failure", {group  => "editusers",
                                            action => "edit",
                                            object => "users"});
@@ -343,6 +344,8 @@ sub update {
     delete $values->{ids};
 
     $dbh->bz_start_transaction();
+
+    $values = { groups => $values->{groups} } unless $user->in_group('editusers');
     foreach my $user (@$user_objects){
         $user->set_all($values);
     }
index 0ae76d70fe456142ebca06ab33b7c6d41171bdc3..bacd08ba1775cf1cd97d8c8dc99b05893addfc82 100644 (file)
@@ -275,6 +275,7 @@ sub update {
 
     # Reject access if there is no sense in continuing.
     $user->in_group('editusers')
+        || $user->can_bless()
         || ThrowUserError("auth_failure", {group  => "editusers",
                                            action => "edit",
                                            object => "users"});
@@ -292,6 +293,8 @@ sub update {
     delete $values->{ids};
 
     $dbh->bz_start_transaction();
+
+    $values = { groups => $values->{groups} } unless $user->in_group('editusers');
     foreach my $user (@$user_objects){
         $user->set_all($values);
     }
@@ -709,7 +712,12 @@ B<EXPERIMENTAL>
 
 =item B<Description>
 
-Updates user accounts in Bugzilla.
+Updates user accounts in Bugzilla. To use this method, you must be a member
+of the C<editusers> group.
+
+If you are not in the C<editusers> group, you may
+add or remove users from groups if you have bless permissions for the groups
+you wish to modify. All other changes will be ignored.
 
 =item B<REST>
 
index e27211a7fa264958a973e266b3565e848e89ca30..b6aaa43e15b9f17de224e6ba97b87e5b82d08cd2 100644 (file)
@@ -162,6 +162,10 @@ Update User
 Updates an existing user account in Bugzilla. You must be authenticated and be
 in the *editusers* group to perform this action.
 
+If you are not in the *editusers* group, you may add or remove users from groups
+if you have bless permissions for the groups you wish to modify. All other changes
+will be ignored.
+
 **Request**
 
 .. code-block:: text