/** * Deletes a PropertyTagEntity identified by its Id * @param propertyTagId * @return */ @HasPermission(permission = Permission.MANAGE_GLOBAL_TAGS) public boolean deletePropertyTag(Integer propertyTagId) { return propertyTagService.deletePropertyTagById(propertyTagId); }
private static List<Action> getRequiredAction(InvocationContext context) { HasPermission permissionMethodAnnotation = getMethodPermissionAnnotation(context); List<Action> actions = new ArrayList<>(); if (permissionMethodAnnotation != null) { if (!permissionMethodAnnotation.action().equals(Action.NULL)) { actions.add(permissionMethodAnnotation.action()); } if (permissionMethodAnnotation.oneOfAction().length > 0) { Collections.addAll(actions, permissionMethodAnnotation.oneOfAction()); } } return actions; }
private static List<Permission> getRequiredPermission(InvocationContext context) { HasPermission permissionMethodAnnotation = getMethodPermissionAnnotation(context); List<Permission> permissions = new ArrayList<>(); if (permissionMethodAnnotation != null) { if (!permissionMethodAnnotation.permission().equals(Permission.DEFAULT)) { permissions.add(permissionMethodAnnotation.permission()); } if (permissionMethodAnnotation.oneOfPermission().length > 0) { Collections.addAll(permissions, permissionMethodAnnotation.oneOfPermission()); } } return permissions; }
private static boolean hasResourceSpecific(InvocationContext context) { HasPermission permissionMethodAnnotation = getMethodPermissionAnnotation(context); return permissionMethodAnnotation != null && permissionMethodAnnotation.resourceSpecific(); }
/** * Returns a list of all Roles (used by REST) * * @return List<RoleEntity> */ @HasPermission(permission = Permission.ASSIGN_REMOVE_PERMISSION) public List<RoleEntity> getAllRoles() { return permissionRepository.getAllRoles(); }
/** * Returns a cached list of all Restrictions assigned to a specific UserRestriction (used by REST) * * @return List<RestrictionEntity> for the logged in user */ @HasPermission(oneOfPermission = { Permission.ASSIGN_REMOVE_PERMISSION, Permission.PERMISSION_DELEGATION }) public List<RestrictionEntity> getRestrictionsForLoggedInUser() { return permissionService.getUserRestrictionsForLoggedInUser(); }
/** * Returns a list of all Permissions of the calling user * * @return List<PermissionEntity> */ @HasPermission(permission = Permission.PERMISSION_DELEGATION) public List<RestrictionEntity> getAllCallerRestrictions() { return permissionService.getAllCallerRestrictions(); }
/** * Returns an uncached list of all available Restrictions assigned to UserRestriction (used by REST) * * @return List<RestrictionEntity> */ @HasPermission(permission = Permission.ASSIGN_REMOVE_PERMISSION) public List<RestrictionEntity> getAllUserRestriction() { return permissionService.getAllUserRestrictions(); }
/** * Returns an uncached list of all available UserRestriction names (used by REST) * * @return List<String> UserRestriction.name */ @HasPermission(oneOfPermission = { Permission.ASSIGN_REMOVE_PERMISSION, Permission.PERMISSION_DELEGATION }) public List<String> getAllUserRestrictionNames() { return permissionRepository.getAllUserRestrictionNames(); }
/** * Persists the given new release. */ @HasPermission(permission = Permission.RELEASE, action = CREATE) public boolean create(ReleaseEntity release) throws GeneralDBException { return persistenceService.saveReleaseEntity(release); }
/** * Returns a list of all PermissionEntities (used by REST) * * @return List<PermissionEntity> */ @HasPermission(permission = Permission.ASSIGN_REMOVE_PERMISSION) public List<PermissionEntity> getAllAvailablePermissions() { return permissionRepository.getAllPermissions(); }
/** * Returns a list of releases for management operations. This means, we * don't care about relations to resources or deployments but only want to * create, edit or delete plain release-instances */ @HasPermission(permission = Permission.RELEASE, action = READ) public List<ReleaseEntity> loadReleasesForMgmt(int startIndex, int length, boolean sortDesc) { return persistenceService.loadReleaseEntities(startIndex, length, sortDesc); }
/** * @return the number of existing releases */ @HasPermission(permission = Permission.RELEASE, action = READ) public int countReleases() { return persistenceService.count(); }
/** * Persists the given release - the already existing instance will be updated. */ @HasPermission(permission = Permission.RELEASE, action = UPDATE) public boolean update(ReleaseEntity release) throws GeneralDBException { return persistenceService.saveReleaseEntity(release); }
@HasPermission(permission = Permission.MANAGE_GLOBAL_FUNCTIONS) public void deleteGlobalFunction(GlobalFunctionEntity function) { functionService.deleteFunction(function); }
@HasPermission(permission = Permission.RELEASE, action = DELETE) public void delete(ReleaseEntity release) { releaseRepository.removeRelease(release); } }
/** * Adds a PropertyTagEntity of PropertyTagType.GLOBAL * @param propertyTagName */ @HasPermission(permission = Permission.MANAGE_GLOBAL_TAGS) public void addGlobalPropertyTag(String propertyTagName) { addPropertyTag(propertyTagName, PropertyTagType.GLOBAL); }
/** * Returns all available Roles with their Restrictions * * @return Map key=Role.name, value=RestrictionDTOs */ @HasPermission(permission = Permission.ASSIGN_REMOVE_PERMISSION) public Map<String, List<RestrictionDTO>> getAllPermissions() { return permissionService.getPermissions(); }
/** * Returns a cached list of all Restrictions assigned to a specific UserRestriction (used by REST) * * @param userName the specific User name - if omitted, the name of the logged in user is used instead * @return List<RestrictionEntity> */ @HasPermission(oneOfPermission = { Permission.ASSIGN_REMOVE_PERMISSION, Permission.PERMISSION_DELEGATION }) public List<RestrictionEntity> getRestrictionsByUserName(String userName) { return permissionService.getUserRestrictions(userName); }
/** * Returns a list of all Restrictions assigned to a specific Role (used by REST) * * @return List<RestrictionEntity> */ @HasPermission(permission = Permission.ASSIGN_REMOVE_PERMISSION) public List<RestrictionEntity> getRestrictionsByRoleName(String roleName) { return permissionRepository.getRoleWithRestrictions(roleName); }