protected void resetPermissions() { cachedPermissions = new HashSet<>(); if(authorizationType == AUTH_TYPE_GLOBAL) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_GRANT) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_REVOKE) { this.permissions = Permissions.ALL.getValue(); } else { throw LOG.engineAuthorizationTypeException(authorizationType, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE); } }
protected void resetPermissions() { cachedPermissions = new HashSet<>(); if(authorizationType == AUTH_TYPE_GLOBAL) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_GRANT) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_REVOKE) { this.permissions = Permissions.ALL.getValue(); } else { throw LOG.engineAuthorizationTypeException(authorizationType, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE); } }
public boolean isEveryPermissionGranted() { if(AUTH_TYPE_REVOKE == authorizationType) { throw LOG.permissionStateException("isEveryPermissionGranted", "REVOKE"); } return permissions == Permissions.ALL.getValue(); }
public boolean isEveryPermissionGranted() { if(AUTH_TYPE_REVOKE == authorizationType) { throw LOG.permissionStateException("isEveryPermissionGranted", "REVOKE"); } return permissions == Permissions.ALL.getValue(); }
protected void resetPermissions() { if(authorizationType == AUTH_TYPE_GLOBAL) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_GRANT) { this.permissions = Permissions.NONE.getValue(); } else if(authorizationType == AUTH_TYPE_REVOKE) { this.permissions = Permissions.ALL.getValue(); } else { throw LOG.engineAuthorizationTypeException(authorizationType, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE); } }
protected static MissingAuthorization asMissingAuthorization(Authorization authorization) { String permissionName = null; String resourceId = null; String resourceName = null; Permission[] permissions = AuthorizationTestUtil.getPermissions(authorization); for (Permission permission : permissions) { if (permission.getValue() != Permissions.NONE.getValue()) { permissionName = permission.getName(); break; } } if (!Authorization.ANY.equals(authorization.getResourceId())) { // missing ANY authorizations are not explicitly represented in the error message resourceId = authorization.getResourceId(); } Resource resource = AuthorizationTestUtil.getResourceByType(authorization.getResourceType()); resourceName = resource.resourceName(); return new MissingAuthorization(permissionName, resourceName, resourceId); }
public boolean isEveryPermissionGranted() { if(AUTH_TYPE_REVOKE == authorizationType) { throw LOG.permissionStateException("isEveryPermissionGranted", "REVOKE"); } return permissions == Permissions.ALL.getValue(); }
if (permission.getValue() != Permissions.NONE.getValue()) { Assert.assertTrue(assertionFailureMessage, message.contains(permission.getName())); break;