summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2016-01-14 14:28:03 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2016-01-14 14:28:03 +0100
commit64043e9bcc4f30be1046fef6f9a9880f4497d59e (patch)
tree1345ccb5d178395d1b0778af679a9cdf9632f0e7 /lib/public
parent8f89e3520d74e1805dc46947742a17683ece6ca7 (diff)
downloadnextcloud-server-64043e9bcc4f30be1046fef6f9a9880f4497d59e.tar.gz
nextcloud-server-64043e9bcc4f30be1046fef6f9a9880f4497d59e.zip
move methods to correct interface, deprecate private interface
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/groupinterface.php68
-rw-r--r--lib/public/userinterface.php68
2 files changed, 134 insertions, 2 deletions
diff --git a/lib/public/groupinterface.php b/lib/public/groupinterface.php
index dbadbfb0dcb..a4acc78e856 100644
--- a/lib/public/groupinterface.php
+++ b/lib/public/groupinterface.php
@@ -37,4 +37,70 @@ namespace OCP;
* @package OCP
* @since 4.5.0
*/
-interface GroupInterface extends \OC_Group_Interface {}
+interface GroupInterface {
+
+ /**
+ * Check if backend implements actions
+ * @param int $actions bitwise-or'ed actions
+ * @return boolean
+ * @since 4.5.0
+ *
+ * Returns the supported actions as int to be
+ * compared with \OC_Group_Backend::CREATE_GROUP etc.
+ */
+ public function implementsActions($actions);
+
+ /**
+ * is user in group?
+ * @param string $uid uid of the user
+ * @param string $gid gid of the group
+ * @return bool
+ * @since 4.5.0
+ *
+ * Checks whether the user is member of a group or not.
+ */
+ public function inGroup($uid, $gid);
+
+ /**
+ * Get all groups a user belongs to
+ * @param string $uid Name of the user
+ * @return array an array of group names
+ * @since 4.5.0
+ *
+ * This function fetches all groups a user belongs to. It does not check
+ * if the user exists at all.
+ */
+ public function getUserGroups($uid);
+
+ /**
+ * get a list of all groups
+ * @param string $search
+ * @param int $limit
+ * @param int $offset
+ * @return array an array of group names
+ * @since 4.5.0
+ *
+ * Returns a list with all groups
+ */
+ public function getGroups($search = '', $limit = -1, $offset = 0);
+
+ /**
+ * check if a group exists
+ * @param string $gid
+ * @return bool
+ * @since 4.5.0
+ */
+ public function groupExists($gid);
+
+ /**
+ * get a list of all users in a group
+ * @param string $gid
+ * @param string $search
+ * @param int $limit
+ * @param int $offset
+ * @return array an array of user ids
+ * @since 4.5.0
+ */
+ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0);
+
+}
diff --git a/lib/public/userinterface.php b/lib/public/userinterface.php
index 22f8d02c4f1..6d048cb7a03 100644
--- a/lib/public/userinterface.php
+++ b/lib/public/userinterface.php
@@ -37,4 +37,70 @@ namespace OCP;
* @package OCP
* @since 4.5.0
*/
-interface UserInterface extends \OC_User_Interface {}
+interface UserInterface {
+
+ /**
+ * Check if backend implements actions
+ * @param int $actions bitwise-or'ed actions
+ * @return boolean
+ *
+ * Returns the supported actions as int to be
+ * compared with \OC_User_Backend::CREATE_USER etc.
+ * @since 4.5.0
+ */
+ public function implementsActions($actions);
+
+ /**
+ * delete a user
+ * @param string $uid The username of the user to delete
+ * @return bool
+ * @since 4.5.0
+ */
+ public function deleteUser($uid);
+
+ /**
+ * Get a list of all users
+ *
+ * @param string $search
+ * @param null|int $limit
+ * @param null|int $offset
+ * @return string[] an array of all uids
+ * @since 4.5.0
+ */
+ public function getUsers($search = '', $limit = null, $offset = null);
+
+ /**
+ * check if a user exists
+ * @param string $uid the username
+ * @return boolean
+ * @since 4.5.0
+ */
+ public function userExists($uid);
+
+ /**
+ * get display name of the user
+ * @param string $uid user ID of the user
+ * @return string display name
+ * @since 4.5.0
+ */
+ public function getDisplayName($uid);
+
+ /**
+ * Get a list of all display names and user ids.
+ *
+ * @param string $search
+ * @param string|null $limit
+ * @param string|null $offset
+ * @return array an array of all displayNames (value) and the corresponding uids (key)
+ * @since 4.5.0
+ */
+ public function getDisplayNames($search = '', $limit = null, $offset = null);
+
+ /**
+ * Check if a user list is available or not
+ * @return boolean if users can be listed or not
+ * @since 4.5.0
+ */
+ public function hasUserListings();
+
+}