| java.lang.Object net.jforum.repository.SecurityRepository
SecurityRepository | public class SecurityRepository implements Cacheable(Code) | | author: Rafael Steil version: $Id: SecurityRepository.java,v 1.25 2006/08/27 01:22:02 rafaelsteil Exp $ |
add | public static synchronized void add(int userId, PermissionControl pc)(Code) | | Adds a new permission control schema to the cache
Parameters: userId - The user's id to associate with the schema Parameters: pc - The PermissionControl instance to add |
canAccess | public static boolean canAccess(int userId, String roleName)(Code) | | |
canAccess | public static boolean canAccess(String roleName, String value)(Code) | | Check if the logged user has access to the role.
This method gets user's id from its session.
Parameters: roleName - The role name to verify Parameters: value - The value relacted to the role to verify for access true if the user has access to the role, false if access is denied |
clean | public static synchronized void clean()(Code) | | Clear all cached security entries.
|
get | public static PermissionControl get(int userId)(Code) | | Gets the permssion schema of some specific user.
If the roles of the user aren't loaded yet, a call
to
SecurityRepository.load(int) will be made.
Parameters: userId - The user's id to get the permissions The PermissionControl instance relatedto the user id passed as argument throws: SecurityLoadException - if case of erros while tryingto load the roles |
remove | public static synchronized void remove(int userId)(Code) | | Remove the cached roles from a specific user.
Parameters: userId - The id of the user to remove from the cache |
|
|