Package cz.metacentrum.perun.core.entry
Class SecurityTeamsManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.SecurityTeamsManagerEntry
- All Implemented Interfaces:
SecurityTeamsManager
- Author:
- Ondrej Velisek invalid input: '<'ondrejvelisek@gmail.com>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdmin
(PerunSession sess, SecurityTeam securityTeam, Group group) Create group as security admins group of given security team (all users in group will have security admin rights)void
addAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) create security admin from given user and add him as security admin of given security teamvoid
addUserToBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user, String description) Add User to black list of security team to filter him out.createSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Create new SecurityTeam.void
deleteSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Delete SecurityTeam.void
deleteSecurityTeam
(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) Delete SecurityTeam.getAdminGroups
(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 list of blacklisted users by 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 list of blacklisted users by security team containing also descriptiongetSecurityTeamById
(PerunSession sess, int id) Find existing SecurityTeam by ID.getSecurityTeamByName
(PerunSession sess, String name) Find existing SecurityTeam by name.getSecurityTeams
(PerunSession sess) Get list of SecurityTeams by access rights - PERUNADMIN : all teams - SECURITYADMIN : teams where user is adminvoid
removeAdmin
(PerunSession sess, SecurityTeam securityTeam, Group group) Remove security admin role for given security team from groupvoid
removeAdmin
(PerunSession sess, SecurityTeam securityTeam, User user) Remove security admin role for given security team from uservoid
removeUserFromBlacklist
(PerunSession sess, SecurityTeam securityTeam, User user) remove user from blacklist of given security teamvoid
setPerunBl
(PerunBl perunBl) void
setSecurityTeamsManagerBl
(SecurityTeamsManagerBl securityTeamsManagerBl) updateSecurityTeam
(PerunSession sess, SecurityTeam securityTeam) Updates SecurityTeam.
-
Constructor Details
-
SecurityTeamsManagerEntry
-
SecurityTeamsManagerEntry
public SecurityTeamsManagerEntry()
-
-
Method Details
-
addAdmin
public void addAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws PrivilegeException, SecurityTeamNotExistsException, UserNotExistsException, AlreadyAdminException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:SecurityTeamsManager
create security admin from given user and add him as security admin of given security team- Specified by:
addAdmin
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-user
- user who will became a security administrator- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
UserNotExistsException
AlreadyAdminException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws PrivilegeException, SecurityTeamNotExistsException, GroupNotExistsException, AlreadyAdminException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:SecurityTeamsManager
Create group as security admins group of given security team (all users in group will have security admin rights)- Specified by:
addAdmin
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-group
- group which members will became a security administrators- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
GroupNotExistsException
AlreadyAdminException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addUserToBlacklist
public void addUserToBlacklist(PerunSession sess, SecurityTeam securityTeam, User user, String description) throws PrivilegeException, SecurityTeamNotExistsException, UserNotExistsException, UserAlreadyBlacklistedException Description copied from interface:SecurityTeamsManager
Add User to black list of security team to filter him out.Description of adding can be null.
- Specified by:
addUserToBlacklist
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-user
-description
-- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
UserNotExistsException
UserAlreadyBlacklistedException
-
createSecurityTeam
public SecurityTeam createSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws PrivilegeException, SecurityTeamExistsException Description copied from interface:SecurityTeamsManager
Create new SecurityTeam.- Specified by:
createSecurityTeam
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
- SecurityTeam object with prefilled name- Returns:
- Newly created Security team with new id
- Throws:
PrivilegeException
- Can do only PerunAdmin.SecurityTeamExistsException
-
deleteSecurityTeam
public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws PrivilegeException, SecurityTeamNotExistsException, RelationExistsException Description copied from interface:SecurityTeamsManager
Delete SecurityTeam.- Specified by:
deleteSecurityTeam
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
RelationExistsException
- if team is assigned to any facility or has blacklisted users.
-
deleteSecurityTeam
public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) throws PrivilegeException, SecurityTeamNotExistsException, RelationExistsException Description copied from interface:SecurityTeamsManager
Delete SecurityTeam.- Specified by:
deleteSecurityTeam
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-forceDelete
- TRUE if Team should be forcefully deleted.- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
RelationExistsException
- if forceDelete == FALSE and team is assigned to any facility or has blacklisted users.
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession sess, SecurityTeam securityTeam) throws SecurityTeamNotExistsException, PrivilegeException Description copied from interface:SecurityTeamsManager
Gets list of all group administrators of the SecurityTeam.- Specified by:
getAdminGroups
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-- Returns:
- list of Group that are admins in the SecurityTeam.
- Throws:
PrivilegeException
SecurityTeamNotExistsException
-
getAdmins
public List<User> getAdmins(PerunSession sess, SecurityTeam securityTeam, boolean onlyDirectAdmins) throws PrivilegeException, SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManager
get all security admins of given security team- Specified by:
getAdmins
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-onlyDirectAdmins
- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of users which are admis of given security team
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
-
getAllSecurityTeams
Description copied from interface:SecurityTeamsManager
get all security teams in perun system- Specified by:
getAllSecurityTeams
in interfaceSecurityTeamsManager
- Parameters:
sess
-- Returns:
- List of SecurityTeams or empty List
- Throws:
PrivilegeException
-
getBlacklist
public List<User> getBlacklist(PerunSession sess, SecurityTeam securityTeam) throws PrivilegeException, SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManager
get list of blacklisted users by security team- Specified by:
getBlacklist
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-- Returns:
- list of blacklisted users by security team
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
-
getBlacklist
public List<User> getBlacklist(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:SecurityTeamsManager
get union of blacklists of all security teams assigned to facility- Specified by:
getBlacklist
in interfaceSecurityTeamsManager
- Parameters:
sess
-facility
-- Returns:
- list of blacklisted users for facility
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamFacilityNotExistsException
-
getBlacklistWithDescription
public List<Pair<User,String>> getBlacklistWithDescription(PerunSession sess, SecurityTeam securityTeam) throws PrivilegeException, SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManager
get list of blacklisted users by security team containing also description- Specified by:
getBlacklistWithDescription
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-- Returns:
- List of Pairs with blacklisted users by security team
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
-
getBlacklistWithDescription
public List<Pair<User,String>> getBlacklistWithDescription(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:SecurityTeamsManager
get union of blacklists of all security teams assigned to facility containing also description- Specified by:
getBlacklistWithDescription
in interfaceSecurityTeamsManager
- Parameters:
sess
-facility
-- Returns:
- List of Pairs with blacklisted users for facility
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamFacilityNotExistsException
-
getPerunBl
-
getSecurityTeamById
public SecurityTeam getSecurityTeamById(PerunSession sess, int id) throws PrivilegeException, SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManager
Find existing SecurityTeam by ID.- Specified by:
getSecurityTeamById
in interfaceSecurityTeamsManager
- Parameters:
sess
-id
-- Returns:
- security team with given id
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
-
getSecurityTeamByName
public SecurityTeam getSecurityTeamByName(PerunSession sess, String name) throws PrivilegeException, SecurityTeamNotExistsException Description copied from interface:SecurityTeamsManager
Find existing SecurityTeam by name.- Specified by:
getSecurityTeamByName
in interfaceSecurityTeamsManager
- Parameters:
sess
-name
-- Returns:
- security team with given name
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
-
getSecurityTeams
Description copied from interface:SecurityTeamsManager
Get list of SecurityTeams by access rights - PERUNADMIN : all teams - SECURITYADMIN : teams where user is admin- Specified by:
getSecurityTeams
in interfaceSecurityTeamsManager
- Parameters:
sess
-- Returns:
- List of SecurityTeams or empty ArrayList
- Throws:
PrivilegeException
-
getSecurityTeamsManagerBl
-
removeAdmin
public void removeAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws PrivilegeException, SecurityTeamNotExistsException, UserNotExistsException, UserNotAdminException, RoleCannotBeManagedException Description copied from interface:SecurityTeamsManager
Remove security admin role for given security team from user- Specified by:
removeAdmin
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-user
-- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
UserNotExistsException
UserNotAdminException
RoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, SecurityTeam securityTeam, Group group) throws PrivilegeException, SecurityTeamNotExistsException, GroupNotExistsException, GroupNotAdminException, RoleCannotBeManagedException Description copied from interface:SecurityTeamsManager
Remove security admin role for given security team from group- Specified by:
removeAdmin
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-group
-- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
GroupNotExistsException
GroupNotAdminException
RoleCannotBeManagedException
-
removeUserFromBlacklist
public void removeUserFromBlacklist(PerunSession sess, SecurityTeam securityTeam, User user) throws PrivilegeException, SecurityTeamNotExistsException, UserNotExistsException, UserAlreadyRemovedException Description copied from interface:SecurityTeamsManager
remove user from blacklist of given security team- Specified by:
removeUserFromBlacklist
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-user
- user who will became a security administrator- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
UserNotExistsException
UserAlreadyRemovedException
-
setPerunBl
-
setSecurityTeamsManagerBl
-
updateSecurityTeam
public SecurityTeam updateSecurityTeam(PerunSession sess, SecurityTeam securityTeam) throws PrivilegeException, SecurityTeamNotExistsException, SecurityTeamExistsException Description copied from interface:SecurityTeamsManager
Updates SecurityTeam.- Specified by:
updateSecurityTeam
in interfaceSecurityTeamsManager
- Parameters:
sess
-securityTeam
-- Returns:
- returns updated SecurityTeam
- Throws:
PrivilegeException
- Can do only PerunAdmin or SecurityAdmin of the SecurityTeamSecurityTeamNotExistsException
SecurityTeamExistsException
-