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

create internal function to get all members of circle, independent of current logged-in user #250

Open
viniciuscb opened this issue Nov 12, 2018 · 2 comments

Comments

@viniciuscb
Copy link
Member

Every time I need to get all the members of a circle I need to set the current User as the circle owner, and then get all members.

			$origUser = $this->userSession->getUser();
			foreach ($circles as $circleId) {
				try {
					$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleId);
					$this->userSession->setUser($this->userManager->get($circle->getOwner()->getUserId()));
					$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleId);
					$members = $circle->getMembers();
					foreach ($members as $member) {
						$users[] = $member->getUserId();
					}
				} catch (QueryException $e) {
				}
			}
			$this->userSession->setUser($origUser);

I needed to do this several times, in an implementation of calendar reminders to circle members and also in circle -> matrix integration. Is there a way in the api to query for all circle members, independently of the current logged-in user? If not yet, can one be created?

@fgsl
Copy link
Contributor

fgsl commented Nov 27, 2018

This feature would be very useful. I sent a pull request for an auditing feature and I already have other demands to improve it, allowing notification (via app activity) of file sharing for all members of a closed circle. But to create this new feature, I need to recover all members of circle. Today, I get notify only admin.

@ArtificialOwl
Copy link
Member

@viniciuscb I think this is fixed, right ?

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

No branches or pull requests

4 participants