Author: tdraier
Date: Wed Aug 29 18:43:35 2007
New Revision: 18303
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18303&repname=
=3Djahia
Log:
fixed issue with fields acl (JAHIA-2193)
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/acl/Jahia=
AbstractACL.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/acl=
/JahiaAbstractACL.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/acl/JahiaAbstractACL.java&rev=3D18=
303&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/acl/Jahia=
AbstractACL.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/acl/Jahia=
AbstractACL.java Wed Aug 29 18:43:35 2007
@@ -733,60 +733,62 @@
* @param user Reference to a non-null user object.
* @param permission Bit index of the requested access, this ind=
ex should be defined as
* a constant in the derived classes.
- * @param checkLocaleEntry if true, check on locale ACL entry.
+ * @param aclIsDefined if true, check on locale ACL entry.
*
* @return Return true on success or false on any failure.
*
* @throws JahiaACLException Throws an exception if the current ACL ob=
ject was not initialized
* correctly.
*/
- public boolean getPermission (JahiaUser user, int permission, boolean =
checkLocaleEntry)
+ public boolean getPermission (JahiaUser user, int permission, boolean =
aclIsDefined)
throws JahiaACLException {
testProxy ();
boolean hasPermission =3D getACL().getPermission (user, permission=
);
if (!hasPermission) {
boolean foundAclEntry =3D false;
- JahiaAclEntry aclEntry =3D getUserEntry (user);
- if (aclEntry =3D=3D null) {
- // we need to investiguate further in group
-
- // first we reduce the permission from admin to write, or
- // from write to read
- /**
- * @todo this is very hardcoded to the existing permissiong
- * and might not work with extended permissions
- */
- aclEntry =3D new JahiaAclEntry (permission - 1, 0);
- Vector v =3D getGroupnameList (aclEntry);
- if (v.size () =3D=3D 0) {
- // if no group permission has been set we assume that
- // no permission is denied, and therefore return true.
- // (note:this is the opposite from the default ACL res=
olution
- // behavior,where we usually assume that if no permiss=
ion
- // exists then it is denied.)
- hasPermission =3D true;
- } else {
- int size =3D v.size ();
- String grpName;
- JahiaGroup grp;
- for (int i =3D 0; i < size; i++) {
- grpName =3D (String) v.get (i);
- grp =3D ServicesRegistry.getInstance ()
- .getJahiaGroupManagerService ()
- .lookupGroup (grpName);
- if (grp !=3D null) {
- if (grp.isMember (user)) {
- JahiaAclEntry grpACLEntry =3D getGroupEntr=
y (grp);
- if (grpACLEntry !=3D null) {
- foundAclEntry =3D true;
- break;
+ if (aclIsDefined) {
+ JahiaAclEntry aclEntry =3D getUserEntry (user);
+ if (aclEntry =3D=3D null) {
+ // we need to investiguate further in group
+
+ // first we reduce the permission from admin to write,=
or
+ // from write to read
+ /**
+ * @todo this is very hardcoded to the existing permis=
siong
+ * and might not work with extended permissions
+ */
+ aclEntry =3D new JahiaAclEntry (permission - 1, 0);
+ Vector v =3D getGroupnameList (aclEntry);
+ if (v.size () =3D=3D 0) {
+ // if no group permission has been set we assume t=
hat
+ // no permission is denied, and therefore return t=
rue.
+ // (note:this is the opposite from the default ACL=
resolution
+ // behavior,where we usually assume that if no per=
mission
+ // exists then it is denied.)
+ hasPermission =3D true;
+ } else {
+ int size =3D v.size ();
+ String grpName;
+ JahiaGroup grp;
+ for (int i =3D 0; i < size; i++) {
+ grpName =3D (String) v.get (i);
+ grp =3D ServicesRegistry.getInstance ()
+ .getJahiaGroupManagerService ()
+ .lookupGroup (grpName);
+ if (grp !=3D null) {
+ if (grp.isMember (user)) {
+ JahiaAclEntry grpACLEntry =3D getGroup=
Entry (grp);
+ if (grpACLEntry !=3D null) {
+ foundAclEntry =3D true;
+ break;
+ }
}
}
}
}
+ } else {
+ foundAclEntry =3D true;
}
- } else {
- foundAclEntry =3D true;
}
if (!foundAclEntry) {
hasPermission =3D true;
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list