|
From: Michael K. <ko...@us...> - 2006-11-24 12:53:33
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16330/org/cobricks/user Modified Files: AccessPermission.java AccessRole.java Log Message: Index: AccessRole.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/AccessRole.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AccessRole.java 7 Dec 2005 14:01:46 -0000 1.3 +++ AccessRole.java 24 Nov 2006 12:53:29 -0000 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -14,7 +14,7 @@ import java.util.*; -import org.apache.log4j.*; +import org.apache.log4j.Logger; /** * @@ -160,6 +160,10 @@ public boolean isUser(int userid) { + if (roletype == ROLETYPE_AUTH) + return true; + if (roletype == ROLETYPE_ALL) + return true; if (users == null) return false; if (users.contains(new Integer(userid))) return true; Index: AccessPermission.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/AccessPermission.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- AccessPermission.java 24 Nov 2006 08:05:57 -0000 1.6 +++ AccessPermission.java 24 Nov 2006 12:53:29 -0000 1.7 @@ -181,14 +181,18 @@ // ... the simplest case is if there are no restricting attributes if (attrs == null) return true; + if (attrs.size()<1) return true; Iterator i = attrs.keySet().iterator(); while (i.hasNext()) { String aname = (String)i.next(); String avalue = (String)attrs.get(aname); + logger.error("3 "+aname+"="+avalue); // handle special keywords if (avalue.equalsIgnoreCase("ownuserid")) avalue = Integer.toString(user.getUserId()); + if (avalue.equalsIgnoreCase("self")) + avalue = Integer.toString(user.getUserId()); if (avalue.equalsIgnoreCase("ownuserclass")) avalue = user.getUserClass(); if (avalue.equalsIgnoreCase("ownuserlogin")) @@ -198,11 +202,13 @@ if (objattrs == null) return false; Object o = objattrs.get(aname); + logger.error("4: "+objattrs); + logger.error("4: "+o); if (o != null) { String avalueaccess = (String)o.toString(); // TBD compare sets, wildcards - + logger.error("compare "+avalueaccess+"-"+avalue); if (!avalueaccess.equalsIgnoreCase(avalue)) return false; } } |