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

limit some feature when Circles is managed by an app #974

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Mar 24, 2022

  • Allow an App to gain control over a Circle:
		/** @var CirclesManager $circleManager */
		$circleManager = \OC::$server->get(CirclesManager::class);
		$circleManager->startSuperSession();
		$circleManager->flagAsAppManaged('tnxgB4xdBpgew6H4l9CJXEUauUNql71');
		$circleManager->stopSession();

  • When marked as AppManaged, the Circle cannot be removed from the OCS API (ie. Contacts App)

  • Allow an App to create its own Entity:

		/** @var CirclesManager $circleManager */
		$circleManager = \OC::$server->get(CirclesManager::class);
		$circleManager->startAppSession('my app', 11010);

		$circle = $circleManager->createCircle(
			'Test Circle',
			$circleManager->getLocalFederatedUser('test1')
		);

identifying as an App does not give more rights. To have rights over a Circle, the Entity of the App needs to be member/moderator/admin of the targetted Circle.

  • Also cleaning some bitwise operations.

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cfg-app branch 3 times, most recently from 0241ff1 to 1cebfde Compare March 29, 2022 12:35
@ArtificialOwl ArtificialOwl marked this pull request as ready for review March 29, 2022 12:36
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cfg-app branch 2 times, most recently from 7f1cf4d to 5b1ab03 Compare March 29, 2022 19:56
Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

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

Didn't test it yet, but codewise it looks well done 👍

lib/Model/Circle.php Outdated Show resolved Hide resolved
lib/CirclesManager.php Show resolved Hide resolved
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl
Copy link
Member Author

/backport to stable23

@ArtificialOwl
Copy link
Member Author

/backport to stable22

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.

2 participants