Author: sshyrkov Date: Wed Oct 10 14:12:04 2007 New Revision: 18818 URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18818&repname= =3Djahia Log: JAHIA-2474: SP3: Url integrity checking: impossible to put url_keys on page= s cross-referenced by another page =
http://www.jahia.net/jira/browse/JAHIA-2474 Resolution: correct engineMap attribute name is used to retrieve groups Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/rights/Man= ageRights.java Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/righ= ts/ManageRights.java URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP= -BRANCH/core/src/java/org/jahia/engines/rights/ManageRights.java&rev=3D1881= 8&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/engines/rights/Man= ageRights.java (original) +++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/rights/Man= ageRights.java Wed Oct 10 14:12:04 2007 @@ -107,9 +107,13 @@ /** * @return a single instance of the object */ - public static synchronized ManageRights getInstance() { + public static ManageRights getInstance() { if (instance =3D=3D null) { - instance =3D new ManageRights(); + synchronized (ManageRights.class) { + if (instance =3D=3D null) { + instance =3D new ManageRights(); + } + } } return instance; } @@ -118,6 +122,7 @@ = // Don't let anyone instantiate this class private ManageRights() { + super(); } = // -------------------------- OTHER METHODS -------------------------- @@ -251,7 +256,7 @@ if(!engineMap.containsKey(READ_GROUPS+"_"+sessionIdentifie= r)) loadACLEntries(jParams, engineMap, theACL, parentACLFi= nder, aclResource, newAcl, sessionIdentifier); final Object o =3D engineMap.get("rightsUpdated"); - if ((o !=3D null && (o).equals(Boolean.TRUE)) || validate(= jParams, engineMap, theACL)){ + if ((o !=3D null && (o).equals(Boolean.TRUE)) || validate(= jParams, engineMap, theACL, sessionIdentifier)){ return null; } final ValidationError ve3 =3D new ValidationError(this, @@ -307,7 +312,6 @@ Integer integer =3D (Integer) engineMap.get("restrictRightsToSite"= ); if(null!=3Dinteger) restrictedSiteID =3D integer.intValue(); - int aclID =3D acl.getID(); Map aclEntries =3D (Map) engineMap.get(ACL_ENTRIES+"_"+sessionIden= tifier); if (aclEntries =3D=3D null) { Set readGroups =3D new HashSet(); @@ -477,7 +481,7 @@ return false; } = - if ( validate(jParams, engineMap, theACL) ) { + if ( validate(jParams, engineMap, theACL, sessionIdentifier) ) { engineMap.put("rightsUpdated", Boolean.TRUE); if (logger.isDebugEnabled()) logger.debug("rightsUpdated: "+Bo= olean.TRUE); return true; @@ -495,7 +499,6 @@ if (logger.isDebugEnabled()) logger.debug("processUserValues: "+a= cl.getID()); = final String cutRestAllInherit =3D jParams.getParameter("cutRestAl= lInherit"); - int aclID =3D acl.getID(); if (logger.isDebugEnabled()) logger.debug("cutRestAllInherit: "+ c= utRestAllInherit); if (cutRestAllInherit !=3D null) { // Is the check box checked ? if (((Integer)engineMap.get(INHERITANCE+"_"+sessionIdentifier)= ).intValue() =3D=3D ACLInfo.INHERITANCE) { // Has it changed ? @@ -640,13 +643,6 @@ return true; } = - private boolean emptyPermissions(String permissions) { - for (int j =3D 0, len =3D permissions.length(); j < len; j++) - if (permissions.charAt(j) !=3D JahiaAbstractACL.SYMBOL_EMPTY) - return false; - return true; - } - private void putInt(Map map, Object key, int value) { map.put(key, new Integer(value)); } = @@ -696,7 +692,7 @@ */ private boolean validate(final ProcessingContext jParams, final HashMap engineMap, - final JahiaBaseACL theACL) throws JahiaExcept= ion { + final JahiaBaseACL theACL, String sessionIden= tifier) throws JahiaException { if (logger.isDebugEnabled()) logger.debug("Validating: " + theACL.= getID()); if (jParams.getSite().getURLIntegrityCheck() !=3D 1) return true; if (jParams.getParameter("ignoreWarnings") =3D=3D null && @@ -706,7 +702,7 @@ = final Map possibleFuture403 =3D contentObjectsPointingOnPage(j= Params); final StringBuffer buff =3D new StringBuffer(); - Set readGroups =3D (Set) engineMap.get(READ_GROUPS+"_"+theACL.= getID()); + Set readGroups =3D (Set) engineMap.get(READ_GROUPS+"_"+session= Identifier); if (possibleFuture403.size() > 0 ) { try { final EngineMessages result =3D new EngineMessages(); _______________________________________________ cvs_list mailing list [email protected] http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list
