Package de.dlr.proseo.model.service
Class SecurityService
java.lang.Object
de.dlr.proseo.model.service.SecurityService
Utility method for accessing Spring Security user data
- Author:
- Dr. Thomas Bassler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the code of the logged in missiongetUser()Gets the name of the logged in userbooleanCheck, whether the logged in user has the given rolebooleanisAuthorizedForMission(String missionCode) Check, whether the logged in user is authorized for the given mission
-
Constructor Details
-
SecurityService
public SecurityService()
-
-
Method Details
-
hasRole
Check, whether the logged in user has the given role- Parameters:
role- the user role to check- Returns:
- true, if the role is in the user's list of roles, false otherwise
-
isAuthorizedForMission
Check, whether the logged in user is authorized for the given mission- Parameters:
missionCode- the mission code to check against- Returns:
- true, if the user is authorized for this mission, false otherwise
-
getUser
Gets the name of the logged in user- Returns:
- the user name
-
getMission
Gets the code of the logged in mission- Returns:
- the mission code
-