diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-01-30 17:24:42 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-01-30 17:24:42 +0100 |
commit | 0f7634eadc2eee3a32116e2b2686ca462dfaaafa (patch) | |
tree | d22b3d8e9b6b83bc47c4b848a6e6823b7d9d86c6 /settings/factory | |
parent | 7e7dd92f6b7c255ea7a94cbcf0e2e762ef49f8ee (diff) | |
download | nextcloud-server-0f7634eadc2eee3a32116e2b2686ca462dfaaafa.tar.gz nextcloud-server-0f7634eadc2eee3a32116e2b2686ca462dfaaafa.zip |
Switch to a factory and add unit tests
Diffstat (limited to 'settings/factory')
-rw-r--r-- | settings/factory/subadminfactory.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/settings/factory/subadminfactory.php b/settings/factory/subadminfactory.php new file mode 100644 index 00000000000..12a45527ae1 --- /dev/null +++ b/settings/factory/subadminfactory.php @@ -0,0 +1,45 @@ +<?php +/** + * @author Lukas Reschke + * @copyright 2015 Lukas Reschke lukas@owncloud.com + * + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Settings\Factory; + +/** + * @package OC\Settings\Factory + */ +class SubAdminFactory { + /** + * Get the groups $uid is SubAdmin of + * @param string $uid + * @return array Array of groups that $uid is subadmin of + */ + function getSubAdminsOfGroups($uid) { + return \OC_SubAdmin::getSubAdminsGroups($uid); + } + + /** + * Whether the $group is accessible to $uid as subadmin + * @param string $uid + * @param string $group + * @return bool + */ + function isGroupAccessible($uid, $group) { + return \OC_SubAdmin::isGroupAccessible($uid, $group); + } + + /** + * Whether $uid is accessible to $subAdmin + * @param string $subAdmin + * @param string $uid + * @return bool + */ + function isUserAccessible($subAdmin, $uid) { + return \OC_SubAdmin::isUserAccessible($subAdmin, $uid); + } +} |