private static boolean hasResourceSpecific(InvocationContext context) { HasPermission permissionMethodAnnotation = getMethodPermissionAnnotation(context); return permissionMethodAnnotation != null && permissionMethodAnnotation.resourceSpecific(); }
@HasPermission(permission = Permission.DEPLOYMENT, action = Action.CREATE, resourceSpecific = true) public void deployPermissionActionCreateForSpecificResourceNeeded() {} }
@HasPermission(permission = Permission.DEPLOYMENT, oneOfAction = { Action.CREATE, Action.UPDATE} ) public void deployPermissionActionCreateOrUpdateNeeded() {}
@HasPermission(permission = Permission.DEPLOYMENT, action = Action.CREATE) public void deployPermissionActionCreateNeeded() {}
@HasPermission(oneOfPermission = { Permission.RESOURCE_RELEASE_COPY_FROM_RESOURCE, Permission.DEPLOYMENT }, oneOfAction = { Action.CREATE, Action.UPDATE} ) public void deployOrCopyFromPermissionActionCreateOrUpdateNeeded() {}
@HasPermission(permission = Permission.DEPLOYMENT) public void deployPermissionNeeded() {}
/** * 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); }
/** * 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 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); }
/** * 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); }
@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 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); }