You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/09/10 16:19:35 UTC
svn commit: r693849 - in
/portals/jetspeed-2/portal/branches/security-refactoring:
components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/
jetspeed-api/src/main/java/org/apache/jetspeed/security/
Author: ate
Date: Wed Sep 10 07:19:35 2008
New Revision: 693849
URL: http://svn.apache.org/viewvc?rev=693849&view=rev
Log:
Renaming the IS_PART association name constant to IS_MEMBER_OF which we currently use.
Adding several others which we will (eventually) support out-of-the-box.
Also adding constants for build-in supported JetspeedPrincipalType for user/group/role
Modified:
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationType.java
portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java?rev=693849&r1=693848&r2=693849&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java Wed Sep 10 07:19:35 2008
@@ -189,7 +189,7 @@
public List<Group> getGroupsForUser(String username)
throws SecurityException
{
- return (List<Group>) super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<Group>) super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
/**
@@ -198,7 +198,7 @@
public List<Group> getGroupsInRole(String roleName)
throws SecurityException
{
- return (List<Group>) super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<Group>) super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
/**
@@ -212,7 +212,7 @@
{
User user = userManager.getUser(username);
Group group = getGroup(groupName);
- super.addAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, user, group);
+ super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, group);
}
catch (PrincipalNotFoundException e)
{
@@ -239,7 +239,7 @@
{
User user = userManager.getUser(username);
Group group = getGroup(groupName);
- super.removeAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, user, group);
+ super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, group);
}
catch (PrincipalAssociationRequiredException e)
{
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java?rev=693849&r1=693848&r2=693849&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java Wed Sep 10 07:19:35 2008
@@ -194,7 +194,7 @@
*/
public List<Role> getRolesForUser(String username) throws SecurityException
{
- return (List<Role>)super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<Role>)super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
/**
@@ -202,7 +202,7 @@
*/
public List<Role> getRolesInGroup(String groupName) throws SecurityException
{
- return (List<Role>)super.getAssociatedFrom(groupName, groupType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<Role>)super.getAssociatedFrom(groupName, groupType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
/**
@@ -215,7 +215,7 @@
{
User user = userManager.getUser(username);
Role role = getRole(roleName);
- super.addAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, user, role);
+ super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, role);
}
catch (PrincipalNotFoundException e)
{
@@ -241,7 +241,7 @@
{
User user = userManager.getUser(username);
Role role = getRole(roleName);
- super.removeAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, user, role);
+ super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, role);
}
catch (PrincipalAssociationRequiredException e)
{
@@ -268,7 +268,7 @@
{
Group group = groupManager.getGroup(groupName);
Role role = getRole(roleName);
- super.addAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, group, role);
+ super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, group, role);
}
catch (PrincipalNotFoundException e)
{
@@ -294,7 +294,7 @@
{
Group group = groupManager.getGroup(groupName);
Role role = getRole(roleName);
- super.removeAssociation(JetspeedPrincipalAssociationType.IS_PART_OF, group, role);
+ super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, group, role);
}
catch (PrincipalAssociationRequiredException e)
{
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java?rev=693849&r1=693848&r2=693849&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java Wed Sep 10 07:19:35 2008
@@ -214,12 +214,12 @@
public List<User> getUsersInGroup(String groupFullPathName) throws SecurityException
{
- return (List<User>) super.getAssociatedFrom(groupFullPathName, groupType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<User>) super.getAssociatedFrom(groupFullPathName, groupType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
public List<User> getUsersInRole(String roleFullPathName) throws SecurityException
{
- return (List<User>) super.getAssociatedFrom(roleFullPathName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF);
+ return (List<User>) super.getAssociatedFrom(roleFullPathName, roleType, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
}
public List<User> lookupUsers(String attributeName, String attributeValue) throws SecurityException
Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationType.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationType.java?rev=693849&r1=693848&r2=693849&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationType.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationType.java Wed Sep 10 07:19:35 2008
@@ -21,8 +21,38 @@
*/
public interface JetspeedPrincipalAssociationType
{
- String IS_A = "is_a"; // FROM node is a TO node.
- String IS_PART_OF = "part_of"; // FROM node is part of TO node.
+ /**
+ * build-in supported @{link {@link #getAssociationName() associationName} "isMemberOf"
+ */
+ String IS_MEMBER_OF_ASSOCIATION_TYPE_NAME = "isMemberOf"; // FROM node is member of TO node
+
+ /**
+ * build-in supported @{link {@link #getAssociationName() associationName} "isChildOf"
+ */
+ String IS_CHILD_OF_ASSOCIATION_TYPE_NAME = "isChildOf"; // FROM node is member of TO node
+
+ /**
+ * build-in supported @{link {@link #getAssociationName() associationName} "isA"
+ *
+ * This association type (between two equal {@link JetspeedPrincipalType}s) represents
+ * a Generalizing Hierarchical relationship where from <em>implies</em> to.
+ */
+ String IS_A_ASSOCIATION_TYPE_NAME = "isA"; // FROM node is a TO node: FROM node implies TO node
+
+ /**
+ * build-in supported @{link {@link #getAssociationName() associationName} "isPartOf"
+ *
+ * This association type (between two equal {@link JetspeedPrincipalType}s) represents
+ * a Aggregating Hierarchical relationship where to <em>implies</em> from.
+ */
+ String IS_PART_OF_ASSOCIATION_TYPE_NAME = "isPartOf"; // FROM node is part of TO node: TO node implies FROM node
+
+ /**
+ * build-in supported @{link {@link #getAssociationName() associationName} "belongsTo"
+ *
+ * This association type represents a (possibly required) constraint where from may only belong to one to
+ */
+ String BELONGS_TO_ASSOCIATION_TYPE_NAME = "belongsTo"; // FROM node is member of TO node: FROM node may only belong to one TO node
String getAssociationName();
Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java?rev=693849&r1=693848&r2=693849&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java Wed Sep 10 07:19:35 2008
@@ -24,6 +24,13 @@
*/
public interface JetspeedPrincipalType
{
+ /** build-in supported JetspeedPrincipalType "group" */
+ String GROUP_TYPE_NAME = "group";
+ /** build-in supported JetspeedPrincipalType "role" */
+ String ROLE_TYPE_NAME = "role";
+ /** build-in supported JetspeedPrincipalType "user" */
+ String USER_TYPE_NAME = "user";
+
String getName();
String getClassName();
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org