[jboss-cvs] jboss-seam/examples/security/src/org/jboss/seam/example/security ...
Shane Bryzak
Shane_Bryzak at symantec.com
Thu Oct 19 21:01:27 EDT 2006
User: sbryzak2
Date: 06/10/19 21:01:27
Modified: examples/security/src/org/jboss/seam/example/security
ProtectedAction.java ProtectedLocal.java
Log:
updated security example to demonstrate object-level dynamic acls
Revision Changes Path
1.6 +22 -0 jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ProtectedAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ProtectedAction.java 9 Oct 2006 23:29:34 -0000 1.5
+++ ProtectedAction.java 20 Oct 2006 01:01:27 -0000 1.6
@@ -4,6 +4,8 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Secure;
+import org.jboss.seam.annotations.Permission;
+import org.jboss.seam.security.SeamSecurityManager;
/**
*
@@ -14,9 +16,29 @@
@Secure(roles = "admin")
public class ProtectedAction implements ProtectedLocal
{
+ @Secure(permissions = {@Permission(name = "protected", action = "call")})
public String foo()
{
System.out.println("protected method foo() successfully called");
return "protected";
}
+
+ public String modifyCustomer()
+ {
+ Customer customer = new Customer();
+
+ SeamSecurityManager.instance().checkPermission(customer, "modify");
+
+ return "modified";
+ }
+
+ public String modifyReadonlyCustomer()
+ {
+ Customer customer = new Customer();
+ customer.setReadonly(true);
+
+ SeamSecurityManager.instance().checkPermission(customer, "modify");
+
+ return "modified";
+ }
}
1.3 +2 -0 jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedLocal.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ProtectedLocal.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedLocal.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ProtectedLocal.java 5 Aug 2006 02:00:55 -0000 1.2
+++ ProtectedLocal.java 20 Oct 2006 01:01:27 -0000 1.3
@@ -7,4 +7,6 @@
public interface ProtectedLocal
{
String foo();
+ String modifyCustomer();
+ String modifyReadonlyCustomer();
}
More information about the jboss-cvs-commits
mailing list