Documentation of 'org.jdesktop.swingx.auth.UserPermissions' Java class
UserPermissions
org.jdesktop.swingx.auth

Class UserPermissions



  • public class UserPermissions
    extends java.lang.Object
    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 Detail

      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.lang.String name,
                                              java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.lang.String name,
                                                 java.beans.PropertyChangeListener listener)
      • getInstance

        public static UserPermissions getInstance()
        Returns the singleton instance of this class. A singleton is used to simplify access for the permissions from every point in the application.
      • getRoles

        public java.lang.String[] getRoles()
        Returns the roles of the currently logged in user
      • isUserInRole

        public boolean isUserInRole(java.lang.String role)
        Returns true if the user is in the given role (case sensitive).
      • isUserInARole

        public boolean isUserInARole(java.lang.String[] roles)
        Returns true if the user is in one of the given roles (case sensitive).
      • isUserInRoles

        public boolean isUserInRoles(java.lang.String[] roles)
        Returns true if the user is in all of the given roles (case sensitive).

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.