Author: shane.bryzak(a)jboss.com
Date: 2008-05-06 23:07:40 -0400 (Tue, 06 May 2008)
New Revision: 8119
Added:
trunk/src/main/org/jboss/seam/annotations/security/permission/Permission.java
trunk/src/main/org/jboss/seam/annotations/security/permission/Permissions.java
Removed:
trunk/src/main/org/jboss/seam/annotations/security/AclFlag.java
trunk/src/main/org/jboss/seam/annotations/security/AclFlags.java
Modified:
trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
Log:
refactored annotations, add method for listing available permission actions
Deleted: trunk/src/main/org/jboss/seam/annotations/security/AclFlag.java
===================================================================
--- trunk/src/main/org/jboss/seam/annotations/security/AclFlag.java 2008-05-05 16:49:14
UTC (rev 8118)
+++ trunk/src/main/org/jboss/seam/annotations/security/AclFlag.java 2008-05-07 03:07:40
UTC (rev 8119)
@@ -1,24 +0,0 @@
-package org.jboss.seam.annotations.security;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Maps a permission for the target class to a bit value
- *
- * @author Shane Bryzak
- */
-@Target({TYPE})
-@Documented
-@Retention(RUNTIME)
-@Inherited
-public @interface AclFlag
-{
- long mask();
- String action();
-}
Deleted: trunk/src/main/org/jboss/seam/annotations/security/AclFlags.java
===================================================================
--- trunk/src/main/org/jboss/seam/annotations/security/AclFlags.java 2008-05-05 16:49:14
UTC (rev 8118)
+++ trunk/src/main/org/jboss/seam/annotations/security/AclFlags.java 2008-05-07 03:07:40
UTC (rev 8119)
@@ -1,23 +0,0 @@
-package org.jboss.seam.annotations.security;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Specifies a list of ACL flags for a class
- *
- * @author Shane Bryzak
- */
-@Target({TYPE})
-@Documented
-@Retention(RUNTIME)
-@Inherited
-public @interface AclFlags
-{
- AclFlag[] value() default {};
-}
Added: trunk/src/main/org/jboss/seam/annotations/security/permission/Permission.java
===================================================================
--- trunk/src/main/org/jboss/seam/annotations/security/permission/Permission.java
(rev 0)
+++
trunk/src/main/org/jboss/seam/annotations/security/permission/Permission.java 2008-05-07
03:07:40 UTC (rev 8119)
@@ -0,0 +1,25 @@
+package org.jboss.seam.annotations.security.permission;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies an allowable permission action for the target class, and allows for an
optional bit mask
+ * value for mapping the permission action to a persistent store
+ *
+ * @author Shane Bryzak
+ */
+@Target({TYPE})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface Permission
+{
+ String action();
+ long mask() default 0;
+}
Added: trunk/src/main/org/jboss/seam/annotations/security/permission/Permissions.java
===================================================================
--- trunk/src/main/org/jboss/seam/annotations/security/permission/Permissions.java
(rev 0)
+++
trunk/src/main/org/jboss/seam/annotations/security/permission/Permissions.java 2008-05-07
03:07:40 UTC (rev 8119)
@@ -0,0 +1,23 @@
+package org.jboss.seam.annotations.security.permission;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies a list of permission actions for a class
+ *
+ * @author Shane Bryzak
+ */
+@Target({TYPE})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface Permissions
+{
+ Permission[] value() default {};
+}
Modified: trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-05-05
16:49:14 UTC (rev 8118)
+++ trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-05-07
03:07:40 UTC (rev 8119)
@@ -430,6 +430,12 @@
{
return listPermissions(target, null);
}
+
+ public List<String> listAvailableActions(Object target)
+ {
+ // TODO implement
+ return null;
+ }
private EntityManager lookupEntityManager()
{
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-05-05
16:49:14 UTC (rev 8118)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-05-07
03:07:40 UTC (rev 8119)
@@ -108,4 +108,9 @@
Identity.instance().checkPermission(permission.getTarget(), PERMISSION_REVOKE);
return permissionStore.revokePermission(permission);
}
+
+ public List<String> listAvailableActions(Object target)
+ {
+ return permissionStore.listAvailableActions(target);
+ }
}
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-05-05
16:49:14 UTC (rev 8118)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-05-07
03:07:40 UTC (rev 8119)
@@ -13,4 +13,5 @@
List<Permission> listPermissions(Object target, String action);
boolean grantPermission(Permission permission);
boolean revokePermission(Permission permission);
+ List<String> listAvailableActions(Object target);
}
Show replies by date