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.LoggerLogger for this class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialise(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.voidInforms any delegate security contexts to reset themselves.voidsaveRolePermissions(String role, List<Permission> rolePermissions) Persists the permission information for this role to the database.voidsaveUserRolesAndPermissions(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:
initialisein interfaceSecurityLoader- Parameters:
properties- Initialisation properties for this loader.- See Also:
-
loadAllRolePermissions
Description copied from interface:SecurityLoaderReturn 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:
loadAllRolePermissionsin interfaceSecurityLoader- Throws:
IOException
-
loadRolePermissions
Description copied from interface:SecurityLoaderReturn List of Permission objects associated with a particular role- Specified by:
loadRolePermissionsin interfaceSecurityLoader- Throws:
IOException
-
loadUserRolePermissions
Description copied from interface:SecurityLoaderReturn 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:
loadUserRolePermissionsin interfaceSecurityLoader- Throws:
IOException
-
loadUserPermissions
Description copied from interface:SecurityLoaderReturns the list of permissions assigned to this user.- Specified by:
loadUserPermissionsin interfaceSecurityLoader- Throws:
IOException
-
loadUserRoles
Description copied from interface:SecurityLoaderReturns the list of roles assigned to this user.- Specified by:
loadUserRolesin interfaceSecurityLoader- Throws:
IOException
-
loadUser
Description copied from interface:SecurityLoaderLoad 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:
loadUserin interfaceSecurityLoader- Returns:
- a User object.
-
loadAllUsers
Description copied from interface:SecurityLoaderReturn 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:
loadAllUsersin interfaceSecurityLoader- Returns:
- A List of Users.
- Throws:
IOException
-
loadAllResources
Description copied from interface:SecurityLoaderReturn 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:
loadAllResourcesin interfaceSecurityLoader- Returns:
- A List of resources.
- Throws:
IOException
-
loadAllActivities
Description copied from interface:SecurityLoaderReturn 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:
loadAllActivitiesin interfaceSecurityLoader- Parameters:
resourceName- The resource we wish to retrieve activities for- Returns:
- A List of activities.
- Throws:
IOException
-
loadAllRoles
Description copied from interface:SecurityLoaderReturn 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:
loadAllRolesin interfaceSecurityLoader- Returns:
- A List of Roles, just the name.
- Throws:
IOException
-
loadAllPermissions
Description copied from interface:SecurityLoaderReturn 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:
loadAllPermissionsin interfaceSecurityLoader- Returns:
- A List of Permission objects available to this application
- Throws:
IOException
-
loadAllRoleDetails
Description copied from interface:SecurityLoaderReturn 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:
loadAllRoleDetailsin interfaceSecurityLoader- Returns:
- A List of Roles, in Map format.
- Throws:
IOException
-
loadAllUserDetails
Description copied from interface:SecurityLoaderReturn 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:
loadAllUserDetailsin interfaceSecurityLoader- Returns:
- A List of Users, in Map format.
- Throws:
IOException
-
resetSecurityContext
Description copied from interface:SecurityLoaderInforms any delegate security contexts to reset themselves.- Specified by:
resetSecurityContextin interfaceSecurityLoader- Throws:
IOException
-
saveUserRolesAndPermissions
public void saveUserRolesAndPermissions(User user, List<String> roles, List<Permission> userPermissions) throws IOException Description copied from interface:SecurityLoaderPersists 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:
saveUserRolesAndPermissionsin interfaceSecurityLoader- Parameters:
user- The user to persist- Throws:
IOException
-
saveRolePermissions
Description copied from interface:SecurityLoaderPersists the permission information for this role to the database. Existing permission information in the database will be removed.- Specified by:
saveRolePermissionsin interfaceSecurityLoader- Throws:
IOException
-