[seam-commits] Seam SVN: r13330 - in modules/security/trunk/examples/idmconsole/src/main: webapp/WEB-INF and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Jul 5 20:04:23 EDT 2010


Author: shane.bryzak at jboss.com
Date: 2010-07-05 20:04:23 -0400 (Mon, 05 Jul 2010)
New Revision: 13330

Added:
   modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityPermission.java
Modified:
   modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml
Log:
initial config for acl based permissions

Added: modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityPermission.java
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityPermission.java	                        (rev 0)
+++ modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityPermission.java	2010-07-06 00:04:23 UTC (rev 13330)
@@ -0,0 +1,129 @@
+package org.jboss.seam.security.examples.idmconsole.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.validation.constraints.NotNull;
+
+/**
+ * This entity stores ACL permissions
+ * 
+ * @author Shane Bryzak
+ */
+ at Entity
+public class IdentityPermission implements Serializable
+{
+   private static final long serialVersionUID = -5366058398015495583L;
+   
+   private Long id;
+   private IdentityObject identityObject;
+   private IdentityObjectRelationshipType relationshipType;
+   private String relationshipName;
+   private String resource;
+   private String permission;
+   
+   /**
+    * Surrogate primary key value of the permission.
+    * @return
+    */
+   @Id @GeneratedValue
+   public Long getId()
+   {
+      return id;
+   }
+   
+   public void setId(Long id)
+   {
+      this.id = id;
+   }
+   
+   /**
+    * Either the specific identity object for which this permission is granted,
+    * or in the case of a permission granted against a group, this property
+    * then represents the "to" side of the group relationship.  Required field. 
+    * 
+    * @return
+    */
+   @NotNull @ManyToOne
+   public IdentityObject getIdentityObject()
+   {
+      return identityObject;
+   }
+   
+   public void setIdentityObject(IdentityObject identityObject)
+   {
+      this.identityObject = identityObject;
+   }
+   
+   /**
+    * If this permission is granted to a group of identities, then this property may
+    * be used to indicate the relationship type of the group membership.  For example,
+    * a group or role relationship.  It is possible that the permission may also be
+    * granted to identities that have *any* sort of membership within a group, in
+    * which case this property would be null.
+    * 
+    * @return
+    */
+   @ManyToOne
+   public IdentityObjectRelationshipType getRelationshipType()
+   {
+      return relationshipType;
+   }
+   
+   public void setRelationshipType(IdentityObjectRelationshipType relationshipType)
+   {
+      this.relationshipType = relationshipType;
+   }
+   
+   /**
+    * If this permission is granted to a group of identities, then this property
+    * may be used to indicate the name for named relationships, such as role
+    * memberships. 
+    * 
+    * @return
+    */
+   public String getRelationshipName()
+   {
+      return relationshipName;
+   }
+   
+   public void setRelationshipName(String relationshipName)
+   {
+      this.relationshipName = relationshipName;
+   }
+   
+   /**
+    * The unique identifier for the resource for which permission is granted
+    * 
+    * @return
+    */
+   public String getResource()
+   {
+      return resource;
+   }
+   
+   public void setResource(String resource)
+   {
+      this.resource = resource;
+   }
+   
+   /**
+    * The permission(s) granted for the resource.  May either be a comma-separated
+    * list of permission names (such as create, delete, etc) or a bitmasked
+    * integer value, in which each bit represents a different permission.
+    * 
+    * @return
+    */
+   public String getPermission()
+   {
+      return permission;
+   }
+   
+   public void setPermission(String permission)
+   {
+      this.permission = permission;
+   }
+}

Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml	2010-07-05 07:12:38 UTC (rev 13329)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml	2010-07-06 00:04:23 UTC (rev 13330)
@@ -5,7 +5,15 @@
 -->
 <beans xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:s="urn:java:seam:core" 
+   xmlns:perm="org.jboss.seam.security.permission"
    xsi:schemaLocation="
       http://java.sun.com/xml/ns/javaee 
       http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+      
+   <perm:JpaPermissionStore>
+      <s:specializes/>
+      
+      <perm:identityPermissionClass>org.jboss.seam.security.examples.idmconsole.model.IdentityPermission</perm:identityPermissionClass>
+   </perm:JpaPermissionStore>
 </beans>



More information about the seam-commits mailing list