Package com.primavera.integration.util
Class SecurityHelper
java.lang.Object
com.primavera.integration.util.SecurityHelper
Helper class providing convenience methods for determining a user's global or project
security privileges
-
Method Summary
Modifier and TypeMethodDescriptionstatic Set<GlobalPrivilege>getGlobalPrivileges(Session session) Gets the set of global privileges for the current userstatic Set<ProjectPrivilege>getProjectPrivilegesByEPS(Session session, ObjectId epsObjectId) Gets the set of project privileges defined for a specific EPS for the current userstatic Set<ProjectPrivilege>getProjectPrivilegesByEPS(Session session, ObjectId epsObjectId, ObjectId userObjectId) Gets the set of project privileges defined for a specific EPS and a specific userstatic Set<ProjectPrivilege>getProjectPrivilegesByProject(Session session, ObjectId projectObjectId) Gets the set of project privileges defined for a specific project for the current userstatic Set<ProjectPrivilege>getProjectPrivilegesByProject(Session session, ObjectId projectObjectId, ObjectId userObjectId) Gets the set of project privileges defined for a specific project and a specific userstatic Set<ProjectPrivilege>getProjectPrivilegesByWbs(Session session, ObjectId wbsObjectId) Gets the set of project privileges defined for a specific wbs for the current userstatic Set<ProjectPrivilege>getProjectPrivilegesByWbs(Session session, ObjectId wbsObjectId, ObjectId userObjectId) static booleanhasAllResourceAccess(Session session) Checks if the current user has all resource accessstatic booleanhasAllResourceAccess(Session session, ObjectId userObjectId) Checks if the current user has all resource accessstatic booleanisSuperUser(Session session) Checks if the current user is an Admin Superuserstatic booleanisSuperUser(Session session, ObjectId userObjectId) Checks if the a specific user is an Admin Superuser
-
Method Details
-
isSuperUser
Checks if the current user is an Admin Superuser- Parameters:
session- the current session- Returns:
- true if the current user is an Admin Superuser
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layer
-
isSuperUser
public static boolean isSuperUser(Session session, ObjectId userObjectId) throws ServerException, NetworkException Checks if the a specific user is an Admin Superuser- Parameters:
session- the current sessionuserObjectId- the unique ID of the user- Returns:
- true if the user is an Admin Superuser
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layer
-
getGlobalPrivileges
public static Set<GlobalPrivilege> getGlobalPrivileges(Session session) throws BusinessObjectException, ServerException, NetworkException Gets the set of global privileges for the current user- Parameters:
session- the current session- Returns:
- Set
set of global privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
getProjectPrivilegesByProject
public static Set<ProjectPrivilege> getProjectPrivilegesByProject(Session session, ObjectId projectObjectId) throws BusinessObjectException, ServerException, NetworkException Gets the set of project privileges defined for a specific project for the current user- Parameters:
session- the current sessionprojectObjectId- the unique ID of the project- Returns:
- Set
set of project privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
getProjectPrivilegesByWbs
public static Set<ProjectPrivilege> getProjectPrivilegesByWbs(Session session, ObjectId wbsObjectId) throws BusinessObjectException, ServerException, NetworkException Gets the set of project privileges defined for a specific wbs for the current user- Parameters:
session- the current sessionwbsObjectId- the unique ID of the project- Returns:
- Set
set of project privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
getProjectPrivilegesByProject
public static Set<ProjectPrivilege> getProjectPrivilegesByProject(Session session, ObjectId projectObjectId, ObjectId userObjectId) throws BusinessObjectException, ServerException, NetworkException Gets the set of project privileges defined for a specific project and a specific user- Parameters:
session- the current sessionprojectObjectId- the unique ID of the projectuserObjectId- the unique ID of the user- Returns:
- Set
set of project privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
getProjectPrivilegesByWbs
public static Set<ProjectPrivilege> getProjectPrivilegesByWbs(Session session, ObjectId wbsObjectId, ObjectId userObjectId) throws BusinessObjectException, ServerException, NetworkException -
getProjectPrivilegesByEPS
public static Set<ProjectPrivilege> getProjectPrivilegesByEPS(Session session, ObjectId epsObjectId) throws BusinessObjectException, ServerException, NetworkException Gets the set of project privileges defined for a specific EPS for the current user- Parameters:
session- the current sessionepsObjectId- the unique ID of the EPS- Returns:
- Set
set of project privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
getProjectPrivilegesByEPS
public static Set<ProjectPrivilege> getProjectPrivilegesByEPS(Session session, ObjectId epsObjectId, ObjectId userObjectId) throws BusinessObjectException, ServerException, NetworkException Gets the set of project privileges defined for a specific EPS and a specific user- Parameters:
session- the current sessionepsObjectId- the unique ID of the EPSuserObjectId- the unique ID of the user- Returns:
- Set
set of project privileges - Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
hasAllResourceAccess
public static boolean hasAllResourceAccess(Session session) throws BusinessObjectException, ServerException, NetworkException Checks if the current user has all resource access- Parameters:
session- the current session- Returns:
- true if the current has all resource access
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
hasAllResourceAccess
public static boolean hasAllResourceAccess(Session session, ObjectId userObjectId) throws BusinessObjectException, ServerException, NetworkException Checks if the current user has all resource access- Parameters:
session- the current sessionuserObjectId- unique ID of the user- Returns:
- true if the current has all resource access
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-