Package cz.metacentrum.perun.core.impl
Class SecurityTeamsManagerImpl
java.lang.Object
cz.metacentrum.perun.core.impl.SecurityTeamsManagerImpl
- All Implemented Interfaces:
SecurityTeamsManagerImplApi
- Author:
- Ondrej Velisek invalid input: '<'ondrejvelisek@gmail.com>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final RowMapper
<SecurityTeam> Converts s ResultSet's row to a SecurityTeam instance.protected static final String
-
Constructor Summary
ConstructorDescriptionSecurityTeamsManagerImpl
(DataSource perunPool) Create new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUserToBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user, String description) Blacklist user by given security team with optional reason in 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
checkUserIsNotSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is not security admin or a member of authorized group of given security team throw exception if it isvoid
checkUserIsSecurityAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) check if user is security admin or a member of authorized group of given security team throw exception if is notcreateSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Create security teamvoid
deleteSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Delete security teamgetAdminGroups
(PerunSession sess, SecurityTeam securityTeam) Gets list of all group administrators of the SecurityTeam.getAdmins
(PerunSession sess, SecurityTeam securityTeam) get all security admins of given security teamget all security teams in perun systemgetBlacklist
(PerunSession sess, List<SecurityTeam> securityTeams) get union of blacklists of security teamsgetBlacklistWithDescription
(PerunSession sess, List<SecurityTeam> securityTeams) get union of blacklists of security teams containing also descriptiongetDirectAdmins
(PerunSession sess, SecurityTeam securityTeam) Gets list of direct user administrators of the securityTeam.getSecurityTeamById
(PerunSession sess, int id) get security team by its idgetSecurityTeamByName
(PerunSession sess, String name) get security team by its nameboolean
isUserBlacklisted
(PerunSession sess, SecurityTeam securityTeam, User user) Check 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 teamupdateSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Update security team
-
Field Details
-
SECURITY_TEAM_MAPPING_SELECT_QUERY
- See Also:
-
SECURITY_TEAM_MAPPER
Converts s ResultSet's row to a SecurityTeam instance.
-
-
Constructor Details
-
SecurityTeamsManagerImpl
Create new instance of this class.
-
-
Method Details
-
addUserToBlacklist
public void addUserToBlacklist(PerunSession sess, SecurityTeam securityTeam, User user, String description) Description copied from interface:SecurityTeamsManagerImplApi
Blacklist user by given security team with optional reason in description.Description can be null.
- Specified by:
addUserToBlacklist
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-user
-description
-
-
checkGroupIsNotSecurityAdmin
public void checkGroupIsNotSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws AlreadyAdminException Description copied from interface:SecurityTeamsManagerImplApi
check if group is not security admin of given security team throw exception if it is- Specified by:
checkGroupIsNotSecurityAdmin
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-group
-- Throws:
AlreadyAdminException
-
checkGroupIsSecurityAdmin
public void checkGroupIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws GroupNotAdminException Description copied from interface:SecurityTeamsManagerImplApi
check if group is security admin of given security team throw exception if is not- Specified by:
checkGroupIsSecurityAdmin
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-group
-- Throws:
GroupNotAdminException
-
checkSecurityTeamExists
public void checkSecurityTeamExists(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerImplApi
check if security team exists throw exception if doesn't- Specified by:
checkSecurityTeamExists
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Throws:
SecurityTeamNotExistsException
-
checkSecurityTeamNotExists
public void checkSecurityTeamNotExists(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamExistsException Description copied from interface:SecurityTeamsManagerImplApi
check if security team does not exist throw exception if do- Specified by:
checkSecurityTeamNotExists
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Throws:
SecurityTeamExistsException
-
checkSecurityTeamUniqueName
public void checkSecurityTeamUniqueName(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamExistsException Description copied from interface:SecurityTeamsManagerImplApi
check if name is unique throw exception if it is not- Specified by:
checkSecurityTeamUniqueName
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Throws:
SecurityTeamExistsException
-
checkUserIsNotSecurityAdmin
public void checkUserIsNotSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws AlreadyAdminException Description copied from interface:SecurityTeamsManagerImplApi
check if user is not security admin or a member of authorized group of given security team throw exception if it is- Specified by:
checkUserIsNotSecurityAdmin
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-user
-- Throws:
AlreadyAdminException
-
checkUserIsSecurityAdmin
public void checkUserIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws UserNotAdminException Description copied from interface:SecurityTeamsManagerImplApi
check if user is security admin or a member of authorized group of given security team throw exception if is not- Specified by:
checkUserIsSecurityAdmin
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-user
-- Throws:
UserNotAdminException
-
createSecurityTeam
Description copied from interface:SecurityTeamsManagerImplApi
Create security team- Specified by:
createSecurityTeam
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Returns:
- Newly created Security team with new id
-
deleteSecurityTeam
public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerImplApi
Delete security team- Specified by:
deleteSecurityTeam
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Throws:
SecurityTeamNotExistsException
-
getAdminGroups
Description copied from interface:SecurityTeamsManagerImplApi
Gets list of all group administrators of the SecurityTeam.- Specified by:
getAdminGroups
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-- Returns:
- list of groups who are admins in the SecurityTeam
-
getAdmins
Description copied from interface:SecurityTeamsManagerImplApi
get all security admins of given security team- Specified by:
getAdmins
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Returns:
- list of users which are security admins in security team
-
getAllSecurityTeams
Description copied from interface:SecurityTeamsManagerImplApi
get all security teams in perun system- Specified by:
getAllSecurityTeams
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-- Returns:
- list of all security teams
-
getBlacklist
Description copied from interface:SecurityTeamsManagerImplApi
get union of blacklists of security teams- Specified by:
getBlacklist
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeams
-- Returns:
- list of blacklisted users for list of given security teams
-
getBlacklistWithDescription
public List<Pair<User,String>> getBlacklistWithDescription(PerunSession sess, List<SecurityTeam> securityTeams) Description copied from interface:SecurityTeamsManagerImplApi
get union of blacklists of security teams containing also description- Specified by:
getBlacklistWithDescription
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeams
-- Returns:
- List of pairs of blacklisted users and description for list of given security teams
-
getDirectAdmins
Description copied from interface:SecurityTeamsManagerImplApi
Gets list of direct user administrators of the securityTeam. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.- Specified by:
getDirectAdmins
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-
-
getSecurityTeamById
public SecurityTeam getSecurityTeamById(PerunSession sess, int id) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerImplApi
get security team by its id- Specified by:
getSecurityTeamById
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-id
-- Returns:
- security team with given id
- Throws:
SecurityTeamNotExistsException
-
getSecurityTeamByName
public SecurityTeam getSecurityTeamByName(PerunSession sess, String name) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerImplApi
get security team by its name- Specified by:
getSecurityTeamByName
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-name
-- Returns:
- security team with given name
- Throws:
SecurityTeamNotExistsException
-
isUserBlacklisted
Description copied from interface:SecurityTeamsManagerImplApi
Check if user is blacklisted by given security team- Specified by:
isUserBlacklisted
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-user
-
-
isUserBlacklisted
Description copied from interface:SecurityTeamsManagerImplApi
Check if user is blacklisted by any security team- Specified by:
isUserBlacklisted
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-user
-
-
removeUserFromAllBlacklists
Description copied from interface:SecurityTeamsManagerImplApi
Remove user from all blacklists- Specified by:
removeUserFromAllBlacklists
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-user
-
-
removeUserFromBlacklist
Description copied from interface:SecurityTeamsManagerImplApi
remove user from blacklist of given security team- Specified by:
removeUserFromBlacklist
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-user
-
-
updateSecurityTeam
public SecurityTeam updateSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManagerImplApi
Update security team- Specified by:
updateSecurityTeam
in interfaceSecurityTeamsManagerImplApi
- Parameters:
sess
-securityTeam
-- Returns:
- updated security team
- Throws:
SecurityTeamNotExistsException
-