Package cz.metacentrum.perun.core.blImpl
Class SecurityTeamsManagerBlImpl
java.lang.Object
cz.metacentrum.perun.core.blImpl.SecurityTeamsManagerBlImpl
- All Implemented Interfaces:
SecurityTeamsManagerBl
- Author:
- Ondrej Velisek <ondrejvelisek@gmail.com>
-
Constructor Summary
ConstructorDescriptionSecurityTeamsManagerBlImpl
(SecurityTeamsManagerImplApi securityTeamsManagerImpl) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUserToBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user, String description) Blacklist user by given security team with description.void
checkGroupIsNotSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, Group group) check if group is not security admin of given security team throw exception if it isvoid
checkGroupIsSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, Group group) check if group is security admin of given security team throw exception if is notvoid
checkSecurityTeamExists
(PerunSession sess, SecurityTeam securityTeam) check if security team exists throw exception if doesn'tvoid
checkSecurityTeamNotExists
(PerunSession sess, SecurityTeam securityTeam) check if security team does not exist throw exception if dovoid
checkSecurityTeamUniqueName
(PerunSession sess, SecurityTeam securityTeam) check if name is unique throw exception if it is notvoid
checkUserIsInBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is blacklisted by given security team throw exception if is notvoid
checkUserIsNotInBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is not blacklisted by given security team throw exception if isvoid
checkUserIsNotSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is not security admin of given security team throw exception if it isvoid
checkUserIsSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is security admin of given security team throw exception if is notcreateSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Create security teamvoid
deleteSecurityTeam
(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) Delete security teamgetAdminGroups
(PerunSession sess, SecurityTeam securityTeam) Gets list of all group administrators of the SecurityTeam.getAdmins
(PerunSession sess, SecurityTeam securityTeam, boolean onlyDirectAdmins) get all security admins of given security teamget all security teams in perun systemgetBlacklist
(PerunSession sess, Facility facility) get union of blacklists of all security teams assigned to facilitygetBlacklist
(PerunSession sess, SecurityTeam securityTeam) get blacklist of security teamgetBlacklistWithDescription
(PerunSession sess, Facility facility) get union of blacklists of all security teams assigned to facility containing also descriptiongetBlacklistWithDescription
(PerunSession sess, SecurityTeam securityTeam) get blacklist of security team containing also descriptionGets the perunBl.getSecurityTeamById
(PerunSession sess, int id) get security team by its idgetSecurityTeamByName
(PerunSession sess, String name) get security team by its namegetSecurityTeams
(PerunSession sess) Get list of SecurityTeams by access rights - PERUNADMIN : all teams - SECURITYADMIN : teams where user is adminGets the securityTeamsManagerImpl.boolean
isUserBlacklisted
(PerunSession sess, SecurityTeam securityTeam, User user) control if user is blacklisted by given security teamboolean
isUserBlacklisted
(PerunSession sess, User user) Check if user is blacklisted by any security teamvoid
removeUserFromAllBlacklists
(PerunSession sess, User user) Remove user from all blacklistsvoid
removeUserFromBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user) remove user from blacklist of given security teamvoid
setPerunBl
(PerunBl perunBl) Sets the perunBl for this instance.updateSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Update security team
-
Constructor Details
-
SecurityTeamsManagerBlImpl
-
-
Method Details
-
addUserToBlacklist
public void addUserToBlacklist(PerunSession sess, SecurityTeam securityTeam, User user, String description) Description copied from interface:SecurityTeamsManagerBl
Blacklist user by given security team with description.Description can be null.
- Specified by:
addUserToBlacklist
in interfaceSecurityTeamsManagerBl
-
checkGroupIsNotSecurityAdmin
public void checkGroupIsNotSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws AlreadyAdminException Description copied from interface:SecurityTeamsManagerBl
check if group is not security admin of given security team throw exception if it is- Specified by:
checkGroupIsNotSecurityAdmin
in interfaceSecurityTeamsManagerBl
- Throws:
AlreadyAdminException
-
checkGroupIsSecurityAdmin
public void checkGroupIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws GroupNotAdminException Description copied from interface:SecurityTeamsManagerBl
check if group is security admin of given security team throw exception if is not- Specified by:
checkGroupIsSecurityAdmin
in interfaceSecurityTeamsManagerBl
- Throws:
GroupNotAdminException
-
checkSecurityTeamExists
public void checkSecurityTeamExists(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerBl
check if security team exists throw exception if doesn't- Specified by:
checkSecurityTeamExists
in interfaceSecurityTeamsManagerBl
- Throws:
SecurityTeamNotExistsException
-
checkSecurityTeamNotExists
public void checkSecurityTeamNotExists(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamExistsException Description copied from interface:SecurityTeamsManagerBl
check if security team does not exist throw exception if do- Specified by:
checkSecurityTeamNotExists
in interfaceSecurityTeamsManagerBl
- Throws:
SecurityTeamExistsException
-
checkSecurityTeamUniqueName
public void checkSecurityTeamUniqueName(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamExistsException Description copied from interface:SecurityTeamsManagerBl
check if name is unique throw exception if it is not- Specified by:
checkSecurityTeamUniqueName
in interfaceSecurityTeamsManagerBl
- Throws:
SecurityTeamExistsException
-
checkUserIsInBlacklist
public void checkUserIsInBlacklist(PerunSession sess, SecurityTeam securityTeam, User user) throws UserAlreadyRemovedException Description copied from interface:SecurityTeamsManagerBl
check if user is blacklisted by given security team throw exception if is not- Specified by:
checkUserIsInBlacklist
in interfaceSecurityTeamsManagerBl
- Throws:
UserAlreadyRemovedException
-
checkUserIsNotInBlacklist
public void checkUserIsNotInBlacklist(PerunSession sess, SecurityTeam securityTeam, User user) throws UserAlreadyBlacklistedException Description copied from interface:SecurityTeamsManagerBl
check if user is not blacklisted by given security team throw exception if is- Specified by:
checkUserIsNotInBlacklist
in interfaceSecurityTeamsManagerBl
- Throws:
UserAlreadyBlacklistedException
-
checkUserIsNotSecurityAdmin
public void checkUserIsNotSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws AlreadyAdminException Description copied from interface:SecurityTeamsManagerBl
check if user is not security admin of given security team throw exception if it is- Specified by:
checkUserIsNotSecurityAdmin
in interfaceSecurityTeamsManagerBl
- Throws:
AlreadyAdminException
-
checkUserIsSecurityAdmin
public void checkUserIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws UserNotAdminException Description copied from interface:SecurityTeamsManagerBl
check if user is security admin of given security team throw exception if is not- Specified by:
checkUserIsSecurityAdmin
in interfaceSecurityTeamsManagerBl
- Throws:
UserNotAdminException
-
createSecurityTeam
Description copied from interface:SecurityTeamsManagerBl
Create security team- Specified by:
createSecurityTeam
in interfaceSecurityTeamsManagerBl
- Returns:
- Newly created Security team with new id
-
deleteSecurityTeam
public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) throws SecurityTeamNotExistsException, RelationExistsException Description copied from interface:SecurityTeamsManagerBl
Delete security team- Specified by:
deleteSecurityTeam
in interfaceSecurityTeamsManagerBl
forceDelete
- TRUE if Team should be forcefully deleted.- Throws:
SecurityTeamNotExistsException
RelationExistsException
- if forceDelete == FALSE and team is assigned to any facility or has blacklisted users.
-
getAdminGroups
Description copied from interface:SecurityTeamsManagerBl
Gets list of all group administrators of the SecurityTeam.- Specified by:
getAdminGroups
in interfaceSecurityTeamsManagerBl
- Returns:
- list of Groups that are admins in the security team
-
getAdmins
Description copied from interface:SecurityTeamsManagerBl
get all security admins of given security team- Specified by:
getAdmins
in interfaceSecurityTeamsManagerBl
- Returns:
- list of users which are security admins in security team
-
getAllSecurityTeams
Description copied from interface:SecurityTeamsManagerBl
get all security teams in perun system- Specified by:
getAllSecurityTeams
in interfaceSecurityTeamsManagerBl
- Returns:
- list of all security teams
-
getBlacklist
Description copied from interface:SecurityTeamsManagerBl
get blacklist of security team- Specified by:
getBlacklist
in interfaceSecurityTeamsManagerBl
- Returns:
- list of blacklisted users by security team
-
getBlacklist
Description copied from interface:SecurityTeamsManagerBl
get union of blacklists of all security teams assigned to facility- Specified by:
getBlacklist
in interfaceSecurityTeamsManagerBl
- Returns:
- list of blacklisted users for facility
-
getBlacklistWithDescription
public List<Pair<User,String>> getBlacklistWithDescription(PerunSession sess, SecurityTeam securityTeam) Description copied from interface:SecurityTeamsManagerBl
get blacklist of security team containing also description- Specified by:
getBlacklistWithDescription
in interfaceSecurityTeamsManagerBl
- Returns:
- List of pairs of blacklisted users by security team
-
getBlacklistWithDescription
Description copied from interface:SecurityTeamsManagerBl
get union of blacklists of all security teams assigned to facility containing also description- Specified by:
getBlacklistWithDescription
in interfaceSecurityTeamsManagerBl
- Returns:
- List of pairs of blacklisted users for facility
-
getPerunBl
Gets the perunBl.- Returns:
- The perunBl.
-
getSecurityTeamById
public SecurityTeam getSecurityTeamById(PerunSession sess, int id) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerBl
get security team by its id- Specified by:
getSecurityTeamById
in interfaceSecurityTeamsManagerBl
- Returns:
- security team with given id
- Throws:
SecurityTeamNotExistsException
-
getSecurityTeamByName
public SecurityTeam getSecurityTeamByName(PerunSession sess, String name) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerBl
get security team by its name- Specified by:
getSecurityTeamByName
in interfaceSecurityTeamsManagerBl
- Returns:
- security team with given name
- Throws:
SecurityTeamNotExistsException
-
getSecurityTeams
Description copied from interface:SecurityTeamsManagerBl
Get list of SecurityTeams by access rights - PERUNADMIN : all teams - SECURITYADMIN : teams where user is admin- Specified by:
getSecurityTeams
in interfaceSecurityTeamsManagerBl
- Returns:
- list of security teams by access rights
-
getSecurityTeamsManagerImpl
Gets the securityTeamsManagerImpl.- Returns:
- The securityTeamsManagerImpl.
-
isUserBlacklisted
Description copied from interface:SecurityTeamsManagerBl
control if user is blacklisted by given security team- Specified by:
isUserBlacklisted
in interfaceSecurityTeamsManagerBl
- Returns:
- true if given user is blacklisted
-
isUserBlacklisted
Description copied from interface:SecurityTeamsManagerBl
Check if user is blacklisted by any security team- Specified by:
isUserBlacklisted
in interfaceSecurityTeamsManagerBl
- Returns:
- true if given user is blacklisted by any security team
-
removeUserFromAllBlacklists
Description copied from interface:SecurityTeamsManagerBl
Remove user from all blacklists- Specified by:
removeUserFromAllBlacklists
in interfaceSecurityTeamsManagerBl
-
removeUserFromBlacklist
Description copied from interface:SecurityTeamsManagerBl
remove user from blacklist of given security team- Specified by:
removeUserFromBlacklist
in interfaceSecurityTeamsManagerBl
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl
- The perunBl.
-
updateSecurityTeam
public SecurityTeam updateSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerBl
Update security team- Specified by:
updateSecurityTeam
in interfaceSecurityTeamsManagerBl
- Returns:
- updated security team
- Throws:
SecurityTeamNotExistsException
-