Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable api getUsers for subadmins #18399

Merged
merged 3 commits into from
Oct 20, 2015
Merged

Conversation

michag86
Copy link
Contributor

Make it possible to use getUsers from provisioning api for subadmins.

} else {
$subAdminOfGroups = \OC_SubAdmin::getSubAdminsGroups($user->getUID());

if($limit === null) { $limit = -1; }
Copy link
Contributor

Choose a reason for hiding this comment

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

please put the statement on a new line.

@MorrisJobke
Copy link
Contributor

Beside my comments this looks good.

@MorrisJobke
Copy link
Contributor

cc @DeepDiver1975 Provisioning API + SubAdmin ❓

@MorrisJobke
Copy link
Contributor

cc @tomneedham

}
$batch = [];

$groupUsers = OC_Group::displayNamesInGroups($subAdminOfGroups, $search, $limit, $offset);
Copy link
Contributor

Choose a reason for hiding this comment

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

No... I just spend some time to get rid of most of the OC_* calls in the provisioning api.

Just use a simple loop and use $this->groupManager->displayNamesInGroups

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rullzer But if I use this in a loop than limit and offset are not used as expected. If the subadmin uses limit=2 and has two groups to manage he gets 4 results.

@rullzer
Copy link
Contributor

rullzer commented Aug 18, 2015

Please fix the test case
And add new test cases

@rullzer
Copy link
Contributor

rullzer commented Aug 18, 2015

Addition does make a lot of sense! Thanks @michag86.

@MorrisJobke
Copy link
Contributor

@rullzer The OC_Subadmin stuff isn't available in any proper implementation 😢

@rullzer
Copy link
Contributor

rullzer commented Aug 19, 2015

@rullzer The OC_Subadmin stuff isn't available in any proper implementation 😢

Well that is known. But the provisioning API is already using the calls currently. So I do not really see an issue with that. It is far from ideal, I admit that.

@rullzer rullzer force-pushed the api-getusers-for-subadmins branch 2 times, most recently from 4acbfb5 to 15b5107 Compare August 19, 2015 08:47
@rullzer
Copy link
Contributor

rullzer commented Aug 19, 2015

Rebased and squashed.

@rullzer
Copy link
Contributor

rullzer commented Aug 19, 2015

Issue for displayNamesInGroups in #18418

@MorrisJobke MorrisJobke added this to the 8.2-current milestone Aug 19, 2015
michag86 and others added 2 commits August 26, 2015 11:00
Now subadmins can get a list of users they are subadmins of.
* Test pass again
* Code coverage getUsers is at 100% again
@scrutinizer-notifier
Copy link

A new inspection was created.

@ghost
Copy link

ghost commented Aug 26, 2015

🚀 Test PASSed.🚀
chuck

@rullzer
Copy link
Contributor

rullzer commented Aug 27, 2015

So oracle is fine now.

Let the reviews begin!

@@ -68,7 +69,31 @@ public function getUsers(){
$limit = !empty($_GET['limit']) ? $_GET['limit'] : null;
$offset = !empty($_GET['offset']) ? $_GET['offset'] : null;

$users = $this->userManager->search($search, $limit, $offset);
// Check if user is logged in
$user = $this->userSession->getUser();
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this already done by the API::SUBADMIN_AUTH?

@MorrisJobke
Copy link
Contributor

Tested and works 👍

CURL command: curl http://test:test@localhost/master/ocs/v1.php/cloud/users

@PVince81
Copy link
Contributor

We're already past feature freeze unfortunately.

@MTRichards @cmonteroluque can we get this useful addition get scheduled for 9.0 ?

@MTRichards MTRichards modified the milestones: 9.0-next, 8.2-current Sep 18, 2015
@MTRichards
Copy link
Contributor

Will link it for consideration

@PVince81
Copy link
Contributor

CC @SergioBertolinSG for additional provisioning API API-level tests

@PVince81
Copy link
Contributor

Tested, works 👍

@DeepDiver1975
Copy link
Member

@SergioBertolinSG please add an integration test to test this behavior - THX

DeepDiver1975 added a commit that referenced this pull request Oct 20, 2015
@DeepDiver1975 DeepDiver1975 merged commit 60abc27 into master Oct 20, 2015
@DeepDiver1975 DeepDiver1975 deleted the api-getusers-for-subadmins branch October 20, 2015 12:28
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 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.

7 participants