You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/08/15 15:09:26 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac2 Identity.java
andreas 2003/08/15 06:09:26
Modified: src/java/org/apache/lenya/cms/ac2 Identity.java
Log:
added method for session access
Revision Changes Path
1.11 +12 -1 cocoon-lenya/src/java/org/apache/lenya/cms/ac2/Identity.java
Index: Identity.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac2/Identity.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Identity.java 11 Aug 2003 16:06:17 -0000 1.10
+++ Identity.java 15 Aug 2003 13:09:26 -0000 1.11
@@ -59,6 +59,7 @@
import java.util.HashSet;
import java.util.Set;
+import org.apache.cocoon.environment.Session;
import org.apache.lenya.cms.ac.AccessControlException;
import org.apache.lenya.cms.ac.Machine;
import org.apache.lenya.cms.ac.User;
@@ -197,6 +198,16 @@
*/
public boolean contains(Identifiable identifiable) {
return identifiables.contains(identifiable);
+ }
+
+ /**
+ * Fetches the identity from a session.
+ * @param session The session.
+ * @return An identity.
+ */
+ public static Identity getIdentity(Session session) {
+ Identity identity = (Identity) session.getAttribute(Identity.class.getName());
+ return identity;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org