|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.auth.UserPermissions
public class UserPermissions
This is a singleton that marks the set of permissions for a given logged in user. It is one of the optional results of a successful login operation. The purpose of this class is to provide a central location and client side bridge to the server side permissions and user roles (see J2EE role based authorization). This class is used by gui widgets and actions to determine visibility and enabled status and thus a UI can adapt itself to users with a lower set of privileges. This class is not meant as a secure barrier! It is only a thin layer to supplant the server side permissions. This class can be compromized by the user and thus its purpose is only to help UI flow and navigation and not to prevent attack against a client side UI. A server implementation must ALWAYS recheck permissions sent by the client regardless of the client.
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
addPropertyChangeListener(String name,
PropertyChangeListener listener)
|
static UserPermissions |
getInstance()
Returns the singleton instance of this class. |
String[] |
getRoles()
Returns the roles of the currently logged in user |
boolean |
isUserInARole(String[] roles)
Returns true if the user is in one of the given roles (case sensitive). |
boolean |
isUserInRole(String role)
Returns true if the user is in the given role (case sensitive). |
boolean |
isUserInRoles(String[] roles)
Returns true if the user is in all of the given roles (case sensitive). |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
removePropertyChangeListener(String name,
PropertyChangeListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String name, PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String name, PropertyChangeListener listener)
public static UserPermissions getInstance()
public String[] getRoles()
public boolean isUserInRole(String role)
public boolean isUserInARole(String[] roles)
public boolean isUserInRoles(String[] roles)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |