Skip to content

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

Merged
ArtificialOwl merged 1 commit intomasterfrom
enh/noid/cfg-app
Mar 31, 2022
Merged

limit some feature when Circles is managed by an app#974
ArtificialOwl merged 1 commit intomasterfrom
enh/noid/cfg-app

Conversation

@ArtificialOwl
Copy link
Copy Markdown
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 requested a review from mejo- March 29, 2022 12:36
@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
Copy Markdown
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 👍

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl
Copy link
Copy Markdown
Member Author

/backport to stable23

@ArtificialOwl
Copy link
Copy Markdown
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