You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-commits@incubator.apache.org by su...@apache.org on 2010/09/06 22:09:54 UTC
svn commit: r993164 - in /incubator/photark/trunk:
photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/
photark-security/src/main/java/org/apache/photark/security/authorization/services/
Author: suho
Date: Mon Sep 6 22:09:54 2010
New Revision: 993164
URL: http://svn.apache.org/viewvc?rev=993164&view=rev
Log:
PHOTARK-57 -Creating Java Doc for Security Modules
Modified:
incubator/photark/trunk/photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/JCRAccessManager.java
incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/AccessManager.java
incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/JSONAccessManager.java
Modified: incubator/photark/trunk/photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/JCRAccessManager.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/JCRAccessManager.java?rev=993164&r1=993163&r2=993164&view=diff
==============================================================================
--- incubator/photark/trunk/photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/JCRAccessManager.java (original)
+++ incubator/photark/trunk/photark-jcr/src/main/java/org/apache/photark/jcr/security/authorization/JCRAccessManager.java Mon Sep 6 22:09:54 2010
@@ -191,7 +191,7 @@ public class JCRAccessManager implements
// ****************************************************************************************
// for lists
- // add user to one of the four lists
+ // add user to one of the four user lists
public synchronized void addUserToList(User user, String listName) {
if (!initialised) {
@@ -353,7 +353,7 @@ public class JCRAccessManager implements
}
}
- // ckeck whether the user is stored in the list
+ // check whether the user is stored in the list
public synchronized boolean isUserStoredInList(String userId, String listName) {
if (userId == null || listName == null || userId.trim().equals("") || listName.trim().equals("")) {
@@ -476,7 +476,7 @@ public class JCRAccessManager implements
// **********************************************************
// for permissions
- // assign Album. Roles , Permissions, User Groups
+ // assign Album User Groups to the Role
public synchronized void addToRole(String albumName, List<String[]> rolesAndUserGroups, String securityToken) {
@@ -989,7 +989,7 @@ public class JCRAccessManager implements
}
- // get user groups owned by the user. If super admin, or all groups
+ // get user groups owned by the user. For super admin all groups
public synchronized List getGroups(String securityToken) {
AccessList accessList = getAccessListFromSecurityToken(securityToken);
@@ -1206,7 +1206,7 @@ public class JCRAccessManager implements
}
- // check is the user in the access token map
+ // check whether the user in the access token map
public boolean isUserActive(String userId) {
return accessTokenMap.containsKey(userId);
Modified: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/AccessManager.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/AccessManager.java?rev=993164&r1=993163&r2=993164&view=diff
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/AccessManager.java (original)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/AccessManager.java Mon Sep 6 22:09:54 2010
@@ -25,36 +25,136 @@ import org.oasisopen.sca.annotation.Remo
/**
* the interface for the local classes
- *
*/
@Remotable
public interface AccessManager {
+
+ /**
+ * creating access list for the users
+ *
+ * @param userId The userID of the user
+ * @param email E-mail of the user
+ * @return AccessList of the user
+ */
AccessList createAccessList(String userId, String email);
+ /**
+ * update existing active access list of the users
+ *
+ * @param userId The userID of the user
+ * @return AccessList of the user
+ */
AccessList updateAccessList(String userId);
+
+ /**
+ * add user to one of the four user lists
+ *
+ * @param user The User
+ * @param listName The name of the list ("blockedUserList","unRegisteredUserList""registeredUserList","superAdminList")
+ */
void addUserToList(User user, String listName);
+ /**
+ * remove users from the List
+ *
+ * @param userId The userID of the user
+ * @param listName The name of the list ("blockedUserList","unRegisteredUserList""registeredUserList","superAdminList")
+ */
void removeUserFromList(String userId, String listName);
+
+ /**
+ * check whether the user is stored in the list
+ *
+ * @param userId The userID of the user
+ * @param listName listName The name of the list ("blockedUserList","unRegisteredUserList""registeredUserList","superAdminList")
+ * @return true if the user is stored, and false if not
+ */
boolean isUserStoredInList(String userId, String listName);
+ /**
+ * get user for the given user id
+ * these users are taken from allUsersGroup
+ *
+ * @param userId The userID of the user
+ * @return The user
+ */
User getUser(String userId);
+
+ /**
+ * check whether the user is permitted to the album
+ * Super admin > owner > other users with the given permission
+ * are allowed
+ *
+ * @param userId The userID of the user
+ * @param albumName The Name of the Album
+ * @param permissionNames The Names of the Allowed Permissions separated by comma (,)
+ * @return true if permitted, else false
+ */
boolean isPermitted(String userId, String albumName, String[] permissionNames);
+
+ /**
+ * get AccessList From UserId
+ *
+ * @param userId The userID of the user
+ * @return AccessList of the user
+ */
AccessList getAccessListFromUserId(String userId);
+
+ /**
+ * check whether the user in the access token map
+ *
+ * @param userId The userID of the user
+ * @return true if the user was provided a Security Token, and the user not logged out yet, else false
+ */
boolean isUserActive(String userId);
+
+ /**
+ * get Security Token From UserId
+ *
+ * @param userId The userID of the user
+ * @return The Security Token of the user
+ */
String getSecurityTokenFromUserId(String userId);
+
+ /**
+ * save access list and token in the access token map
+ *
+ * @param accessList Access list of the user
+ * @param token Security Token of the user
+ */
void putAccessListAndToken(AccessList accessList, String token);
+
+ /**
+ * remove access list and token from the access token map
+ *
+ * @param userId The userID of the user
+ */
void removeAccessListAndToken(String userId);
+
+ /**
+ * get AccessList From SecurityToken
+ *
+ * @param token Security Token of the user
+ * @return Access list of the user
+ */
AccessList getAccessListFromSecurityToken(String token);
+
+ /**
+ * get UserId From SecurityToken
+ *
+ * @param token Security Token of the user
+ * @return The userID of the user
+ */
String getUserIdFromSecurityToken(String token);
}
Modified: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/JSONAccessManager.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/JSONAccessManager.java?rev=993164&r1=993163&r2=993164&view=diff
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/JSONAccessManager.java (original)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/services/JSONAccessManager.java Mon Sep 6 22:09:54 2010
@@ -32,34 +32,119 @@ import org.oasisopen.sca.annotation.Remo
@Remotable
public interface JSONAccessManager {
- // role
-
+ /**
+ * to get all the users from the list
+ *
+ * @param listName Name of the list ("blockedUserList","unRegisteredUserList""registeredUserList","superAdminList")
+ * @param securityToken Security token
+ * @return Array of Users
+ */
User[] getUsersFromList(String listName, String securityToken);
+ /**
+ * replace the users in the list
+ *
+ * @param userIds The new users' userIDs
+ * @param listName Name of the list ("blockedUserList","unRegisteredUserList""registeredUserList","superAdminList")
+ * @param securityToken Security token
+ */
void replaceUsersInList(String[] userIds, String listName, String securityToken);
+ //
+
+ /**
+ * get all available roles
+ *
+ * @return Array of all Roles
+ */
public Role[] getRoles();
+
+ /**
+ * add or update roles
+ *
+ * @param roleName The new Role name
+ * @param permissions The permissions to the role Separated by comma (,)
+ * @param securityToken Security token
+ */
public void addRole(String roleName, String permissions, String securityToken);
+
+ /**
+ * delete roles
+ *
+ * @param roleName The Role to be deleted
+ * @param securityToken Security token
+ */
public void deleteRole(String roleName, String securityToken);
+
+ /**
+ * get all available permissions
+ *
+ * @return Array of Permissions
+ */
public Permission[] getPermissions();
+
+ /**
+ * assign Album, User Groups to the Role
+ *
+ * @param albumName Name of the Album that need to be assigned to the Role
+ * @param RolesAndUserGroups A list that contains a String array of size=2, [Role name, UserGroup name separated by comma]
+ * @param securityToken Security Token
+ */
public void addToRole(String albumName, List<String[]> RolesAndUserGroups, String securityToken);
+
+ /**
+ * get the permission information for the Album
+ *
+ * @param albumName Album Name
+ * @param securityToken Security Token
+ * @return An Object array, here each Object contains a String array of Size=2 where String [Role name][UserGroup name separated by comma]
+ */
public Object[] getAlbumPermissionInfo(String albumName, String securityToken);
- // user
+ // get all the users; registered, blocked, and unregistered (logged in but not registered)
+
+ /**
+ * get all the users; registered, blocked, and unregistered (unregistered mean logged in, but not registered in the system)
+ *
+ * @return Array of users
+ */
User[] getAllUsers();
- // user Groups
+ // get user groups owned by the user. For super admin all groups
+
+ /**
+ * get user groups owned by the user. For super admin all groups
+ *
+ * @param securityToken Security Token
+ * @return List which contains Objects, here each Object contains a String array of Size=2 where String [Role name][UserGroup name separated by comma]
+ */
public List getGroups(String securityToken);
+
+ /**
+ * add or update user group
+ *
+ * @param groupName Name of the Group
+ * @param users Name of the users Separated by comma
+ * @param securityToken Security Token
+ */
public void addGroup(String groupName, String users, String securityToken);
+
+ /**
+ * delete the user group
+ *
+ * @param groupName Name of the group
+ * @param securityToken Security Token
+ */
+
public void deleteGroup(String groupName, String securityToken);
}