Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Display group display name instead of gid #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrow4a
Copy link

@mrow4a mrow4a commented May 6, 2018

Proof of concept try-out:

  • Refacftor API to return gid and displayname of group
  • Adjust unit tests
  • Add support for showing in UI displayname

How did I test? Created guest user with - owncloud/guests#200 - Should work also with customgroups.

@CLAassistant
Copy link

CLAassistant commented May 6, 2018

CLA assistant check
All committers have signed the CLA.

@mrow4a mrow4a force-pushed the displayname_support branch 2 times, most recently from 20b5161 to f397652 Compare May 6, 2018 16:33
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

Just a few notes. I will try this later (today?)

if (!empty($groups)) {
foreach ($groups as $key => $group) {
// Is probably subadmin
// FIXME: Can not admin actually create users ??
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this is building the list of groups that a subadmin has "control" over. In the webUI user management page, a subadmin only sees the groups that they are subadmin of. So they can only adjust membership of those.

Also, they cannot remove a user from all groups that the subadmin has "control" of. i.e. a subadmin cannot "lose control" of a user in their group(s). But a subadmin who is subadmin of multiple groups can add/move users between those groups.

The UI enforces that OK (before this PR - I will test this PR soon to see if there is any regression). We should check the private API used underneath here, to make sure a subadmin cannot "hack" add extra groups in their browser console and then get any level of control over those groups.

$items = array_flip($userlistParams['subadmingroups']);
unset($items['admin']);
$userlistParams['subadmingroups'] = array_flip($items);
for($i=0; $i < count($allGroups); $i++){
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: need to check where this subadmin groups array ends up being used. The code here looks like it might show a lot of subadmin groups. Maybe that is OK - it will be all the groups that some user could be made a subadmin of.

@mrow4a mrow4a force-pushed the displayname_support branch from f397652 to 5bd4c3c Compare May 10, 2018 10:58
@mrow4a mrow4a changed the title [WIP] Display group display name instead of gid Display group display name instead of gid May 10, 2018
@mrow4a
Copy link
Author

mrow4a commented May 10, 2018

@phil-davis @PVince81 Ok, there were not many changes required. This implementation should work, but needs some unit and integration tests to be passed.

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.

3 participants