Skip to content

Do not try to make user subadmin of group twice - #15564

Merged
PVince81 merged 1 commit into
owncloud:masterfrom
rullzer:fix_13709
Apr 13, 2015
Merged

PVince81 merged 1 commit into
owncloud:masterfrom
rullzer:fix_13709

Conversation

@rullzer

@rullzer rullzer commented Apr 13, 2015

Copy link
Copy Markdown
Contributor

As stated in #13709

If the provisioning api is used to make a user subadmin of a group that user is already a subadmin just return success. In my opinion returning success is better than returning an error since the desired outcome is already in place.

Added unit test to ensure things keep working.

Probably best to get this into 8.1

@karlitschek probably a good idea to backport to 8.0 as well

CC: @DeepDiver1975 @LukasReschke @MorrisJobke

Comment thread apps/provisioning_api/lib/users.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small o is a type or misnamed method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rename this btw. without problems. PHP function names are case insensitive:

Note: Function names are case-insensitive, though it is usually good form to call functions as they appear in their declaration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed ;)

@MorrisJobke

Copy link
Copy Markdown
Contributor

Works 👍

For those who want to use curl to test this:

curl -X POST http://mjob:mjob@localhost/master/ocs/v1.php/cloud/users/USERNAME/subadmins -d 'groupid=GROUPNAME'

If the provisioning api is used to make a user subadmin of a group that user
is already a subadmin just return success.

Added unit test to ensure things keep working.
@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 1 new issues, 1 updated code elements

@ghost

ghost commented Apr 13, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11448/
🚀 Test PASSed.🚀
chuck

@PVince81

Copy link
Copy Markdown
Contributor

👍

PVince81 pushed a commit that referenced this pull request Apr 13, 2015
Do not try to make user subadmin of group twice
@PVince81
PVince81 merged commit b67301e into owncloud:master Apr 13, 2015
@rullzer

rullzer commented Apr 14, 2015

Copy link
Copy Markdown
Contributor Author

@karlitschek should this be backported to stable8 as well?

@karlitschek

Copy link
Copy Markdown
Contributor

yes. please backport

@rullzer

rullzer commented Apr 14, 2015

Copy link
Copy Markdown
Contributor Author

Backport PR in #15610

MorrisJobke added a commit that referenced this pull request Apr 28, 2015
@rullzer
rullzer deleted the fix_13709 branch May 22, 2015 11:51
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants