Class NullSecurityLoaderImpl
- All Implemented Interfaces:
SecurityLoader
SecurityLoader
class, that does absolutely nothing.
All methods do nothing or return empty lists, and searches for user or role IDs return -1.
- Author:
- knoxg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.log4j.Logger
Logger for this class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialise
(Map<String, Object> properties) Initialise this loader.loadAllActivities
(String resourceName) Return a List of all activities in this security context for a given resource, identified by String.Return a List of all permissions in this security context, as Permission objects.Return a List of all resources in this security context, identified by String.Return a List of all roles in this security context.Return a structured list of application specific Permission objects which is used to preload the SecurityContext rolePermission cache.Return a List of all roles in this security context, identified by String.Return a List of all users in this security context.Return a list of User objects representing all users contained in this security context.loadRolePermissions
(String role) Return List of Permission objects associated with a particular roleloadUser
(long userId) Load a user.loadUserPermissions
(User user) Returns the list of permissions assigned to this user.loadUserRolePermissions
(User user) Return a list of Permission objects associated with the roles possessed by a particular user.loadUserRoles
(User user) Returns the list of roles assigned to this user.void
Informs any delegate security contexts to reset themselves.void
saveRolePermissions
(String role, List<Permission> rolePermissions) Persists the permission information for this role to the database.void
saveUserRolesAndPermissions
(User user, List<String> roles, List<Permission> userPermissions) Persists the role and permission information recorded for this user to the database.
-
Field Details
-
logger
Logger for this class
-
-
Constructor Details
-
NullSecurityLoaderImpl
public NullSecurityLoaderImpl()
-
-
Method Details
-
initialise
Initialise this loader.- Specified by:
initialise
in interfaceSecurityLoader
- Parameters:
properties
- Initialisation properties for this loader.- See Also:
-
loadAllRolePermissions
Description copied from interface:SecurityLoader
Return a structured list of application specific Permission objects which is used to preload the SecurityContext rolePermission cache. Each permission returned must be a role-based Permission.- Specified by:
loadAllRolePermissions
in interfaceSecurityLoader
- Throws:
IOException
-
loadRolePermissions
Description copied from interface:SecurityLoader
Return List of Permission objects associated with a particular role- Specified by:
loadRolePermissions
in interfaceSecurityLoader
- Throws:
IOException
-
loadUserRolePermissions
Description copied from interface:SecurityLoader
Return a list of Permission objects associated with the roles possessed by a particular user. Equivalent to appending the results of callingSecurityLoader.loadRolePermissions(String)
for each role that a user is in.- Specified by:
loadUserRolePermissions
in interfaceSecurityLoader
- Throws:
IOException
-
loadUserPermissions
Description copied from interface:SecurityLoader
Returns the list of permissions assigned to this user.- Specified by:
loadUserPermissions
in interfaceSecurityLoader
- Throws:
IOException
-
loadUserRoles
Description copied from interface:SecurityLoader
Returns the list of roles assigned to this user.- Specified by:
loadUserRoles
in interfaceSecurityLoader
- Throws:
IOException
-
loadUser
Description copied from interface:SecurityLoader
Load a user. Will not load any role or permission data for that user.Will probably throw an IOException if the user doesn't exist.
- Specified by:
loadUser
in interfaceSecurityLoader
- Returns:
- a User object.
-
loadAllUsers
Description copied from interface:SecurityLoader
Return a list of User objects representing all users contained in this security context. Permission information relating to that user is not populated unless the 'populatePermission' parameter is set to true.The information returned by this function may be cached, depending on the initialisation properties of the security context.
- Specified by:
loadAllUsers
in interfaceSecurityLoader
- Returns:
- A List of Users.
- Throws:
IOException
-
loadAllResources
Description copied from interface:SecurityLoader
Return a List of all resources in this security context, identified by String.The information returned by this function may be cached, depending on the initialisation properties of the security context.
- Specified by:
loadAllResources
in interfaceSecurityLoader
- Returns:
- A List of resources.
- Throws:
IOException
-
loadAllActivities
Description copied from interface:SecurityLoader
Return a List of all activities in this security context for a given resource, identified by String.The information returned by this function may be cached, depending on the initialisation properties of the security context.
- Specified by:
loadAllActivities
in interfaceSecurityLoader
- Parameters:
resourceName
- The resource we wish to retrieve activities for- Returns:
- A List of activities.
- Throws:
IOException
-
loadAllRoles
Description copied from interface:SecurityLoader
Return a List of all roles in this security context, identified by String.The information returned by this function may be cached, depending on the initialisation properties of the security context.
- Specified by:
loadAllRoles
in interfaceSecurityLoader
- Returns:
- A List of Roles, just the name.
- Throws:
IOException
-
loadAllPermissions
Description copied from interface:SecurityLoader
Return a List of all permissions in this security context, as Permission objects. (User, role and criteria fields will be left blank in these objects).The information returned by this function may be cached, depending on the initialisation properties of the security context.
- Specified by:
loadAllPermissions
in interfaceSecurityLoader
- Returns:
- A List of Permission objects available to this application
- Throws:
IOException
-
loadAllRoleDetails
Description copied from interface:SecurityLoader
Return a List of all roles in this security context. Each role is returned as a Map containing (by default) the keys roleId, roleName, description- Specified by:
loadAllRoleDetails
in interfaceSecurityLoader
- Returns:
- A List of Roles, in Map format.
- Throws:
IOException
-
loadAllUserDetails
Description copied from interface:SecurityLoader
Return a List of all users in this security context. Each user is returned as a Map containing (by default) the keys userId, name- Specified by:
loadAllUserDetails
in interfaceSecurityLoader
- Returns:
- A List of Users, in Map format.
- Throws:
IOException
-
resetSecurityContext
Description copied from interface:SecurityLoader
Informs any delegate security contexts to reset themselves.- Specified by:
resetSecurityContext
in interfaceSecurityLoader
- Throws:
IOException
-
saveUserRolesAndPermissions
public void saveUserRolesAndPermissions(User user, List<String> roles, List<Permission> userPermissions) throws IOException Description copied from interface:SecurityLoader
Persists the role and permission information recorded for this user to the database. Existing role and permission information in the database will be removed.- Specified by:
saveUserRolesAndPermissions
in interfaceSecurityLoader
- Parameters:
user
- The user to persist- Throws:
IOException
-
saveRolePermissions
Description copied from interface:SecurityLoader
Persists the permission information for this role to the database. Existing permission information in the database will be removed.- Specified by:
saveRolePermissions
in interfaceSecurityLoader
- Throws:
IOException
-