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

fix: Return correct list of managers for a user #48538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pytal
Copy link
Member

@Pytal Pytal commented Oct 2, 2024

Summary

Fix #47642

Subadmins may not have access to certain users so we only return the uids for users that are accessible.

Checklist

@Pytal Pytal added this to the Nextcloud 31 milestone Oct 2, 2024
@Pytal Pytal requested review from artonge, come-nc and a team October 2, 2024 18:32
@Pytal Pytal self-assigned this Oct 2, 2024
@Pytal Pytal requested review from icewind1991 and removed request for a team October 2, 2024 18:32
@@ -536,13 +556,27 @@ public function setQuota($quota) {
}

public function getManagerUids(): array {
$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.

To make it cleared as there is already a lot of reference to user in this file.

Suggested change
$user = $this->userSession->getUser();
$connectedUser = $this->userSession->getUser();

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

It feels arbitrary to me to be checking permissions for the logged in user in this method.

What if some code from a public page needs to list the managers from a user?
You should filter this from the calling controller, not in the User class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: accounts -> error message as group manager when you are not allowed to fetch the line manager details
3 participants