use of org.apache.archiva.redback.rbac.RbacObjectInvalidException in project archiva by apache.
the class ArchivaRbacManager method removePermission.
@Override
public void removePermission(Permission permission) throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException {
boolean allFailed = true;
Exception lastException = null;
for (RBACManager rbacManager : rbacManagersPerId.values()) {
try {
rbacManager.removePermission(permission);
permissionsCache.remove(permission.getName());
allFailed = false;
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new RbacManagerException(lastException.getMessage(), lastException);
}
}
use of org.apache.archiva.redback.rbac.RbacObjectInvalidException in project archiva by apache.
the class ArchivaRbacManager method savePermission.
@Override
public Permission savePermission(Permission permission) throws RbacObjectInvalidException, RbacManagerException {
boolean allFailed = true;
Exception lastException = null;
for (RBACManager rbacManager : rbacManagersPerId.values()) {
try {
if (rbacManager.isReadOnly()) {
permission = rbacManager.savePermission(permission);
allFailed = false;
}
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new RbacManagerException(lastException.getMessage(), lastException);
}
return permission;
}
use of org.apache.archiva.redback.rbac.RbacObjectInvalidException in project archiva by apache.
the class ArchivaRbacManager method saveResource.
@Override
public Resource saveResource(Resource resource) throws RbacObjectInvalidException, RbacManagerException {
boolean allFailed = true;
Exception lastException = null;
for (RBACManager rbacManager : rbacManagersPerId.values()) {
try {
if (!rbacManager.isReadOnly()) {
resource = rbacManager.saveResource(resource);
allFailed = false;
}
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new RbacManagerException(lastException.getMessage(), lastException);
}
return resource;
}
use of org.apache.archiva.redback.rbac.RbacObjectInvalidException in project archiva by apache.
the class ArchivaRbacManager method removeResource.
@Override
public void removeResource(Resource resource) throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException {
boolean allFailed = true;
Exception lastException = null;
for (RBACManager rbacManager : rbacManagersPerId.values()) {
try {
rbacManager.removeResource(resource);
resourcesCache.remove(resource.getIdentifier());
allFailed = false;
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new RbacManagerException(lastException.getMessage(), lastException);
}
}
use of org.apache.archiva.redback.rbac.RbacObjectInvalidException in project archiva by apache.
the class ArchivaRbacManager method removeOperation.
@Override
public void removeOperation(Operation operation) throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException {
boolean allFailed = true;
Exception lastException = null;
for (RBACManager rbacManager : rbacManagersPerId.values()) {
try {
rbacManager.removeOperation(operation);
operationsCache.remove(operation.getName());
allFailed = false;
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new RbacManagerException(lastException.getMessage(), lastException);
}
}
Aggregations