public class ComponentPermissions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ComponentRestriction |
ACCESS_DENIED_OVERLAY
Shared instance of the component restriction that displays an opaque access denied overlay
|
static ComponentPermissions |
DEFAULT_PERMISSIONS |
static ComponentRestriction |
DISABLE
Shared instance of the component restriction that disables a component
|
static ComponentRestriction |
DISABLE_SCRIPTS
Shared instance of the component restriction that disables event scripts
|
static ComponentRestriction |
HIDE
Shared instance of the component restriction that hides a component
|
Constructor and Description |
---|
ComponentPermissions()
Deprecated.
|
ComponentPermissions(boolean inheritPermissions,
java.lang.String[] requiredRoles,
ComponentRestriction[] restrictions) |
ComponentPermissions(ComponentPermissions copy) |
ComponentPermissions(SecuritySettings legacy)
Creates a component permissions object based on a legacy SecuritySetttings object
|
Modifier and Type | Method and Description |
---|---|
ComponentPermissions |
createInvertedCopy(java.util.List<java.lang.String> roles) |
boolean |
equals(java.lang.Object obj) |
static ComponentPermissions |
get(javax.swing.JComponent component)
Fetch the security settings for this component.
|
java.lang.String[] |
getRequiredRoles() |
ComponentRestriction[] |
getRestrictions() |
boolean |
hasAccess(java.util.List<java.lang.String> roles)
Checks whether or not a user with the given roles has access according to the permissions represented by this
object.
|
boolean |
isInheritPermissions() |
boolean |
isInvertRoles() |
static void |
set(javax.swing.JComponent component,
ComponentPermissions permissions)
Set the permissions on a component.
|
void |
setInheritPermissions(boolean inheritPermissions) |
void |
setInvertRoles(boolean invertRoles) |
void |
setRequiredRoles(java.lang.String[] requiredRoles) |
void |
setRestrictions(ComponentRestriction[] restrictions) |
public static final ComponentRestriction DISABLE
public static final ComponentRestriction HIDE
public static final ComponentRestriction DISABLE_SCRIPTS
public static final ComponentRestriction ACCESS_DENIED_OVERLAY
public static final ComponentPermissions DEFAULT_PERMISSIONS
@Deprecated public ComponentPermissions()
public ComponentPermissions(ComponentPermissions copy)
public ComponentPermissions(boolean inheritPermissions, java.lang.String[] requiredRoles, ComponentRestriction[] restrictions)
public ComponentPermissions(SecuritySettings legacy)
public static ComponentPermissions get(javax.swing.JComponent component)
public static void set(javax.swing.JComponent component, ComponentPermissions permissions)
public boolean hasAccess(java.util.List<java.lang.String> roles)
public ComponentPermissions createInvertedCopy(java.util.List<java.lang.String> roles)
public boolean isInvertRoles()
public void setInvertRoles(boolean invertRoles)
public boolean isInheritPermissions()
public void setInheritPermissions(boolean inheritPermissions)
public java.lang.String[] getRequiredRoles()
public void setRequiredRoles(java.lang.String[] requiredRoles)
public ComponentRestriction[] getRestrictions()
public void setRestrictions(ComponentRestriction[] restrictions)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object