[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...
Shane Bryzak
sbryzak at redhat.com
Wed May 23 04:24:48 EDT 2007
User: sbryzak2
Date: 07/05/23 04:24:48
Modified: src/main/org/jboss/seam/security Identity.java
RuleBasedIdentity.java
Log:
more digest stuff
Revision Changes Path
1.81 +16 -10 jboss-seam/src/main/org/jboss/seam/security/Identity.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Identity.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- Identity.java 22 May 2007 00:56:25 -0000 1.80
+++ Identity.java 23 May 2007 08:24:48 -0000 1.81
@@ -130,18 +130,24 @@
}
/**
- * If there is a principal set, then the user is logged in.
*
*/
public boolean isLoggedIn()
{
- // See if the user can log in
- if (getPrincipal() == null && isCredentialsSet() && !Contexts.getEventContext().isSet(LOGIN_TRIED))
+ return isLoggedIn(false);
+ }
+
+ public boolean isLoggedIn(boolean attemptLogin)
+ {
+ if (attemptLogin && getPrincipal() == null && isCredentialsSet() &&
+ Contexts.isEventContextActive() &&
+ !Contexts.getEventContext().isSet(LOGIN_TRIED))
{
Contexts.getEventContext().set(LOGIN_TRIED, true);
quietLogin();
}
+ // If there is a principal set, then the user is logged in.
return getPrincipal() != null;
}
@@ -155,7 +161,7 @@
return subject;
}
- protected boolean isCredentialsSet()
+ public boolean isCredentialsSet()
{
return username != null;
}
@@ -374,7 +380,7 @@
*/
public boolean hasRole(String role)
{
- isLoggedIn();
+ isLoggedIn(true);
for ( Group sg : subject.getPrincipals(Group.class) )
{
@@ -450,7 +456,7 @@
*/
public void checkRole(String role)
{
- isLoggedIn();
+ isLoggedIn(true);
if ( !hasRole(role) )
{
@@ -478,7 +484,7 @@
*/
public void checkPermission(String name, String action, Object...arg)
{
- isLoggedIn();
+ isLoggedIn(true);
if ( !hasPermission(name, action, arg) )
{
@@ -607,7 +613,7 @@
public void checkEntityPermission(Object entity, EntityAction action)
{
- isLoggedIn();
+ isLoggedIn(true);
Entity e = Entity.forClass(entity.getClass());
1.12 +1 -3 jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RuleBasedIdentity.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- RuleBasedIdentity.java 21 May 2007 03:47:38 -0000 1.11
+++ RuleBasedIdentity.java 23 May 2007 08:24:48 -0000 1.12
@@ -104,8 +104,6 @@
@Override
public boolean hasPermission(String name, String action, Object...arg)
{
- isLoggedIn();
-
WorkingMemory securityContext = getSecurityContext();
if (securityContext == null) return false;
More information about the jboss-cvs-commits
mailing list