diff options
author | Joas Schilling <coding@schilljs.com> | 2018-02-21 13:53:06 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-02-23 11:19:32 +0300 |
commit | 262654303ef6f544fb706a7ab754f8f3fc544628 (patch) | |
tree | e76a1928dd697f001b03e4c216321b540ab78f14 /appinfo | |
parent | c8911608091e853c10f7260f53c9077f3eff644a (diff) |
Allow to select which groups can impersonate
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 7 | ||||
-rw-r--r-- | appinfo/info.xml | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index d7d9a57..cc62bb6 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -17,6 +17,11 @@ $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener( 'OC\Settings\Users::loadAdditionalScripts', function() { - \OCP\Util::addScript('impersonate', 'impersonate'); + $authorized = json_decode(\OC::$server->getConfig()->getAppValue('impersonate', 'authorized', '["admin"]')); + $userGroups = \OC::$server->getGroupManager()->getUserGroupIds(\OC::$server->getUserSession()->getUser()); + + if (array_intersect($userGroups, $authorized)) { + \OCP\Util::addScript('impersonate', 'impersonate'); + } } ); diff --git a/appinfo/info.xml b/appinfo/info.xml index 190986d..22d092f 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -20,18 +20,26 @@ The administrator is then logged-in as the user, to switch back to the regular u - This app is not compatible with instances that have encryption enabled. - While impersonate actions are logged note that actions performed impersonated will be logged as the impersonated user. - Impersonating an user is only possible after their first login.]]></description> + <version>1.1.0</version> <licence>agpl</licence> <author>Nextcloud</author> <namespace>Impersonate</namespace> + <category>tools</category> <website>https://github.com/nextcloud/impersonate</website> <bugs>https://github.com/nextcloud/impersonate/issues</bugs> <repository>https://github.com/nextcloud/impersonate.git</repository> + <screenshot>https://raw.githubusercontent.com/nextcloud/impersonate/master/screenshots/1.png</screenshot> <screenshot>https://raw.githubusercontent.com/nextcloud/impersonate/master/screenshots/2.png</screenshot> <screenshot>https://raw.githubusercontent.com/nextcloud/impersonate/master/screenshots/3.png</screenshot> + <dependencies> <nextcloud min-version="14" max-version="14" /> </dependencies> + + <settings> + <admin>OCA\Impersonate\AdminSettings</admin> + </settings> </info> |