aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Group/Group.php9
-rw-r--r--lib/private/Group/Manager.php8
-rw-r--r--lib/public/IGroup.php4
-rw-r--r--lib/public/IGroupManager.php4
4 files changed, 13 insertions, 12 deletions
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php
index 69dce215694..32ab79adab3 100644
--- a/lib/private/Group/Group.php
+++ b/lib/private/Group/Group.php
@@ -29,6 +29,7 @@
namespace OC\Group;
use OCP\IGroup;
+use OCP\IUser;
class Group implements IGroup {
/** @var null|string */
@@ -119,10 +120,10 @@ class Group implements IGroup {
/**
* check if a user is in the group
*
- * @param \OC\User\User $user
+ * @param IUser $user
* @return bool
*/
- public function inGroup($user) {
+ public function inGroup(IUser $user) {
if (isset($this->users[$user->getUID()])) {
return true;
}
@@ -138,9 +139,9 @@ class Group implements IGroup {
/**
* add a user to the group
*
- * @param \OC\User\User $user
+ * @param IUser $user
*/
- public function addUser($user) {
+ public function addUser(IUser $user) {
if ($this->inGroup($user)) {
return;
}
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php
index 61b47fdd448..6d4f5a091c6 100644
--- a/lib/private/Group/Manager.php
+++ b/lib/private/Group/Manager.php
@@ -246,10 +246,10 @@ class Manager extends PublicEmitter implements IGroupManager {
}
/**
- * @param \OC\User\User|null $user
+ * @param IUser|null $user
* @return \OC\Group\Group[]
*/
- public function getUserGroups($user) {
+ public function getUserGroups(IUser $user= null) {
if (!$user instanceof IUser) {
return [];
}
@@ -303,10 +303,10 @@ class Manager extends PublicEmitter implements IGroupManager {
/**
* get a list of group ids for a user
- * @param \OC\User\User $user
+ * @param IUser $user
* @return array with group ids
*/
- public function getUserGroupIds($user) {
+ public function getUserGroupIds(IUser $user) {
return array_map(function($value) {
return (string) $value;
}, array_keys($this->getUserGroups($user)));
diff --git a/lib/public/IGroup.php b/lib/public/IGroup.php
index aa51e51046c..788287b4f86 100644
--- a/lib/public/IGroup.php
+++ b/lib/public/IGroup.php
@@ -60,7 +60,7 @@ interface IGroup {
* @return bool
* @since 8.0.0
*/
- public function inGroup($user);
+ public function inGroup(IUser $user);
/**
* add a user to the group
@@ -68,7 +68,7 @@ interface IGroup {
* @param \OCP\IUser $user
* @since 8.0.0
*/
- public function addUser($user);
+ public function addUser(IUser $user);
/**
* remove a user from the group
diff --git a/lib/public/IGroupManager.php b/lib/public/IGroupManager.php
index 4d76fa76fb3..be322b64325 100644
--- a/lib/public/IGroupManager.php
+++ b/lib/public/IGroupManager.php
@@ -100,14 +100,14 @@ interface IGroupManager {
* @return \OCP\IGroup[]
* @since 8.0.0
*/
- public function getUserGroups($user);
+ public function getUserGroups(IUser $user = null);
/**
* @param \OCP\IUser $user
* @return array with group names
* @since 8.0.0
*/
- public function getUserGroupIds($user);
+ public function getUserGroupIds(IUser $user);
/**
* get a list of all display names in a group