[jboss-cvs] jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace ...
Shane Bryzak
Shane_Bryzak at symantec.com
Wed Dec 13 23:12:21 EST 2006
User: sbryzak2
Date: 06/12/13 23:12:21
Modified: examples/seamspace/src/org/jboss/seam/example/seamspace
AuthenticatorAction.java Member.java
Log:
fixed compiler errors in security example
Revision Changes Path
1.2 +6 -5 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/AuthenticatorAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AuthenticatorAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/AuthenticatorAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- AuthenticatorAction.java 31 Oct 2006 02:54:36 -0000 1.1
+++ AuthenticatorAction.java 14 Dec 2006 04:12:21 -0000 1.2
@@ -5,10 +5,11 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.security.Authentication;
+import org.jboss.seam.security.Identity;
import org.jboss.seam.security.AuthenticationException;
import org.jboss.seam.security.UsernamePasswordToken;
import org.jboss.seam.security.provider.AuthenticationProvider;
+import org.jboss.seam.security.Role;
/**
* Authenticates the member against the database
@@ -21,7 +22,7 @@
@In(create=true)
private EntityManager entityManager;
- public Authentication authenticate(Authentication authentication)
+ public Identity authenticate(Identity authentication)
throws AuthenticationException
{
try
@@ -32,10 +33,10 @@
.setParameter("password", authentication.getCredentials())
.getSingleResult();
- String[] roles = new String[member.getRoles().size()];
+ Role[] roles = new Role[member.getRoles().size()];
int idx = 0;
- for (Role role : member.getRoles())
- roles[idx++] = role.getName();
+ for (MemberRole mr : member.getRoles())
+ roles[idx++] = new Role(mr.getName());
return new UsernamePasswordToken(authentication.getPrincipal(),
authentication.getCredentials(), roles);
1.5 +3 -9 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Member.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Member.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Member.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Member.java 9 Nov 2006 00:48:41 -0000 1.4
+++ Member.java 14 Dec 2006 04:12:21 -0000 1.5
@@ -7,8 +7,6 @@
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
-import org.jboss.seam.annotations.security.AclProvider;
-import org.jboss.seam.annotations.security.DefinePermissions;
import org.jboss.seam.annotations.Name;
/**
@@ -18,17 +16,13 @@
*/
@Entity
@Name("member")
- at DefinePermissions(permissions = {
- @AclProvider(action = "update", provider = "persistentAclProvider", mask = 0x0002),
- @AclProvider(action = "delete", provider = "persistentAclProvider", mask = 0x0004)
-})
public class Member implements Serializable
{
private Integer memberId;
private String username;
private String password;
- private Set<Role> roles;
+ private Set<MemberRole> roles;
@Id
public Integer getMemberId()
@@ -63,12 +57,12 @@
@ManyToMany
@JoinTable(name = "MemberRoles")
- public Set<Role> getRoles()
+ public Set<MemberRole> getRoles()
{
return roles;
}
- public void setRoles(Set<Role> roles)
+ public void setRoles(Set<MemberRole> roles)
{
this.roles = roles;
}
More information about the jboss-cvs-commits
mailing list