@ -58,23 +59,15 @@ public class AclPermissionCacheOptimizer implements PermissionCacheOptimizer {
@@ -58,23 +59,15 @@ public class AclPermissionCacheOptimizer implements PermissionCacheOptimizer {
@ -76,9 +77,7 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@@ -76,9 +77,7 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@ -86,7 +85,6 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@@ -86,7 +85,6 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@ -94,72 +92,51 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@@ -94,72 +92,51 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
@ -75,10 +76,8 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
@@ -75,10 +76,8 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
@ -88,18 +87,7 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
@@ -88,18 +87,7 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
}
// Need to process the Collection for this invocation
thrownewAuthorizationServiceException("A Collection or an array (or null) was required as the "
+"returnedObject, but the returnedObject was: "+returnedObject);
}
Filtererfilterer=getFilterer(returnedObject);
// Locate unauthorised Collection elements
for(ObjectdomainObject:filterer){
@ -108,20 +96,25 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
@@ -108,20 +96,25 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
@ -83,13 +83,11 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
@@ -83,13 +83,11 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
// AclManager interface contract prohibits nulls
// As they have permission to null/nothing, grant access
logger.debug("Return object is not applicable for this provider, skipping");
returnreturnedObject;
}
@ -97,14 +95,13 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
@@ -97,14 +95,13 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
if(!this.supports(attr)){
continue;
}
// Need to make an access decision on this invocation
// Need to make an access decision on this invocation
@ -65,60 +65,54 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
@@ -65,60 +65,54 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
@ -192,7 +186,6 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
@@ -192,7 +186,6 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
@ -86,32 +86,15 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
@@ -86,32 +86,15 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
@ -121,7 +104,6 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
@@ -121,7 +104,6 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
@ -130,6 +112,19 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
@@ -130,6 +112,19 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
"Principal does not have required ACL permissions to perform requested operation");
@ -39,21 +39,18 @@ public class CumulativePermission extends AbstractPermission {
@@ -39,21 +39,18 @@ public class CumulativePermission extends AbstractPermission {
@ -77,22 +77,18 @@ public class DefaultPermissionFactory implements PermissionFactory {
@@ -77,22 +77,18 @@ public class DefaultPermissionFactory implements PermissionFactory {
@ -100,7 +96,6 @@ public class DefaultPermissionFactory implements PermissionFactory {
@@ -100,7 +96,6 @@ public class DefaultPermissionFactory implements PermissionFactory {
Assert.hasText(permissionName,"Permission name required");
Integermask=perm.getMask();
// Ensure no existing Permission uses this integer or code
@ -124,32 +119,22 @@ public class DefaultPermissionFactory implements PermissionFactory {
@@ -124,32 +119,22 @@ public class DefaultPermissionFactory implements PermissionFactory {
// To get this far, we have to use a CumulativePermission
@ -158,13 +143,10 @@ public class DefaultPermissionFactory implements PermissionFactory {
@@ -158,13 +143,10 @@ public class DefaultPermissionFactory implements PermissionFactory {
@ -74,18 +74,13 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@@ -74,18 +74,13 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
// Attempt to find exact match for this permission mask and SID
booleanscanNextSid=true;
for(AccessControlEntryace:aces){
if(isGranted(ace,p)&&ace.getSid().equals(sid)){
// Found a matching ACE, so its authorization decision will
// prevail
@ -94,7 +89,6 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@@ -94,7 +89,6 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
if(!administrativeMode){
this.auditLogger.logIfNeeded(true,ace);
}
returntrue;
}
@ -105,13 +99,11 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@@ -105,13 +99,11 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
// Store first rejection for auditing reasons
firstRejection=ace;
}
scanNextSid=false;// helps break the loop
break;// exit aces loop
}
}
if(!scanNextSid){
break;// exit SID for loop (now try next permission)
}
@ -124,7 +116,6 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@@ -124,7 +116,6 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@ -133,10 +124,9 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
@@ -133,10 +124,9 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
// We have a parent, so let them try to find a matching ACE
@ -132,11 +113,9 @@ public class EhCacheBasedAclCache implements AclCache {
@@ -132,11 +113,9 @@ public class EhCacheBasedAclCache implements AclCache {
@ -40,7 +40,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@@ -40,7 +40,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@ -68,23 +67,22 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@@ -68,23 +67,22 @@ public class ObjectIdentityImpl implements ObjectIdentity {
thrownewIdentityUnavailableException("Could not extract identity from object "+object,ex);
}
Assert.notNull(result,"getId() is required to return a non-null value");
Assert.isInstanceOf(Serializable.class,result,"Getter must provide a return value of type Serializable");
this.identifier=(Serializable)result;
}
/**
@ -95,17 +93,15 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@@ -95,17 +93,15 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@ -118,7 +114,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@@ -118,7 +114,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
returnfalse;
}
}
returnthis.type.equals(other.type);
}
@ -149,7 +144,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@@ -149,7 +144,6 @@ public class ObjectIdentityImpl implements ObjectIdentity {
@ -56,13 +56,10 @@ public class SidRetrievalStrategyImpl implements SidRetrievalStrategy {
@@ -56,13 +56,10 @@ public class SidRetrievalStrategyImpl implements SidRetrievalStrategy {
@ -60,9 +60,7 @@ public class SpringCacheBasedAclCache implements AclCache {
@@ -60,9 +60,7 @@ public class SpringCacheBasedAclCache implements AclCache {
@ -72,9 +70,7 @@ public class SpringCacheBasedAclCache implements AclCache {
@@ -72,9 +70,7 @@ public class SpringCacheBasedAclCache implements AclCache {
@ -98,22 +94,18 @@ public class SpringCacheBasedAclCache implements AclCache {
@@ -98,22 +94,18 @@ public class SpringCacheBasedAclCache implements AclCache {
@ -122,7 +114,6 @@ public class SpringCacheBasedAclCache implements AclCache {
@@ -122,7 +114,6 @@ public class SpringCacheBasedAclCache implements AclCache {
@ -167,26 +168,19 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -167,26 +168,19 @@ public class BasicLookupStrategy implements LookupStrategy {
@ -228,18 +222,9 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -228,18 +222,9 @@ public class BasicLookupStrategy implements LookupStrategy {
// Lookup the parents, now that our JdbcTemplate has released the database
// connection (SEC-547)
if(parentsToLookup.size()>0){
@ -247,6 +232,14 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -247,6 +232,14 @@ public class BasicLookupStrategy implements LookupStrategy {
@ -269,68 +262,48 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -269,68 +262,48 @@ public class BasicLookupStrategy implements LookupStrategy {
// Add loaded batch (all elements 100% initialized) to results
result.putAll(loadedBatch);
// Add the loaded batch to the cache
for(AclloadedAcl:loadedBatch.values()){
this.aclCache.putInCache((AclImpl)loadedAcl);
}
currentBatchToLoad.clear();
}
}
}
returnresult;
}
@ -343,37 +316,20 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -343,37 +316,20 @@ public class BasicLookupStrategy implements LookupStrategy {
// Lookup the parents, now that our JdbcTemplate has released the database
// connection (SEC-547)
@ -383,11 +339,9 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -383,11 +339,9 @@ public class BasicLookupStrategy implements LookupStrategy {
// Finally, convert our "acls" containing StubAclParents into true Acls
Map<ObjectIdentity,Acl>resultMap=newHashMap<>();
for(AclinputAcl:acls.values()){
Assert.isInstanceOf(AclImpl.class,inputAcl,"Map should have contained an AclImpl");
Assert.isInstanceOf(Long.class,((AclImpl)inputAcl).getId(),"Acl.getId() must be Long");
@ -395,6 +349,24 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -395,6 +349,24 @@ public class BasicLookupStrategy implements LookupStrategy {
@ -402,7 +374,6 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -402,7 +374,6 @@ public class BasicLookupStrategy implements LookupStrategy {
@ -460,9 +431,7 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -460,9 +431,7 @@ public class BasicLookupStrategy implements LookupStrategy {
if(isPrincipal){
returnnewPrincipalSid(sid);
}
else{
returnnewGrantedAuthoritySid(sid);
}
returnnewGrantedAuthoritySid(sid);
}
/**
@ -564,7 +533,6 @@ public class BasicLookupStrategy implements LookupStrategy {
@@ -564,7 +533,6 @@ public class BasicLookupStrategy implements LookupStrategy {