Skip to content
Snippets Groups Projects
Commit a42ea472 authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story ac2 rework. We now expose isMember() in GroupPersistence instead of in UserPersistence.

parent dea40303
No related branches found
No related tags found
No related merge requests found
...@@ -195,4 +195,20 @@ public abstract interface GroupPersistence<T extends Principal> ...@@ -195,4 +195,20 @@ public abstract interface GroupPersistence<T extends Principal>
throws UserNotFoundException, GroupNotFoundException, throws UserNotFoundException, GroupNotFoundException,
TransientException, AccessControlException; TransientException, AccessControlException;
/**
* Check whether the user is a member of the group.
*
* @param userID The userID.
* @param groupID The groupID.
*
* @return true or false
*
* @throws UserNotFoundException If the user is not found.
* @throws TransientException If an temporary, unexpected problem occurred.
* @throws AccessControlException If the operation is not permitted.
*/
public boolean isMember(T userID, String groupID)
throws UserNotFoundException, TransientException,
AccessControlException;
} }
...@@ -175,20 +175,4 @@ public interface UserPersistence<T extends Principal> ...@@ -175,20 +175,4 @@ public interface UserPersistence<T extends Principal>
void deleteUser(T userID) void deleteUser(T userID)
throws UserNotFoundException, TransientException, throws UserNotFoundException, TransientException,
AccessControlException; AccessControlException;
/**
* Check whether the user is a member of the group.
*
* @param userID The userID.
* @param groupID The groupID.
*
* @return true or false
*
* @throws UserNotFoundException If the user is not found.
* @throws TransientException If an temporary, unexpected problem occurred.
* @throws AccessControlException If the operation is not permitted.
*/
boolean isMember(T userID, String groupID)
throws UserNotFoundException, TransientException,
AccessControlException;
} }
...@@ -259,4 +259,12 @@ public class LdapGroupPersistence<T extends Principal> ...@@ -259,4 +259,12 @@ public class LdapGroupPersistence<T extends Principal>
} }
} }
public boolean isMember(T userID, String groupID)
throws UserNotFoundException, TransientException,
AccessControlException
{
return (new LdapUserPersistence<T>()).isMember(userID, groupID);
}
} }
...@@ -362,7 +362,7 @@ public class LdapUserPersistence<T extends Principal> ...@@ -362,7 +362,7 @@ public class LdapUserPersistence<T extends Principal>
* @throws TransientException If an temporary, unexpected problem occurred. * @throws TransientException If an temporary, unexpected problem occurred.
* @throws AccessControlException If the operation is not permitted. * @throws AccessControlException If the operation is not permitted.
*/ */
public boolean isMember(T userID, String groupID) protected boolean isMember(T userID, String groupID)
throws UserNotFoundException, TransientException, throws UserNotFoundException, TransientException,
AccessControlException AccessControlException
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment