Class ComponentPermissions
- java.lang.Object
-
- com.inductiveautomation.vision.api.client.components.model.security.ComponentPermissions
-
public class ComponentPermissions extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ComponentRestriction
ACCESS_DENIED_OVERLAY
Shared instance of the component restriction that displays an opaque access denied overlaystatic ComponentPermissions
DEFAULT_PERMISSIONS
static ComponentRestriction
DISABLE
Shared instance of the component restriction that disables a componentstatic ComponentRestriction
DISABLE_SCRIPTS
Shared instance of the component restriction that disables event scriptsstatic ComponentRestriction
HIDE
Shared instance of the component restriction that hides a component
-
Constructor Summary
Constructors Constructor Description ComponentPermissions()
For serialization only.ComponentPermissions(boolean inheritPermissions, java.lang.String[] requiredRoles, ComponentRestriction[] restrictions)
ComponentPermissions(SecuritySettings legacy)
Creates a component permissions object based on a legacy SecuritySetttings objectComponentPermissions(ComponentPermissions copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentPermissions
createInvertedCopy(java.util.List<java.lang.String> roles)
boolean
equals(java.lang.Object obj)
static ComponentPermissions
fromJson(com.inductiveautomation.ignition.common.gson.JsonElement json)
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)
com.inductiveautomation.ignition.common.gson.JsonElement
toJson()
-
-
-
Field Detail
-
DISABLE
public static final ComponentRestriction DISABLE
Shared instance of the component restriction that disables a component
-
HIDE
public static final ComponentRestriction HIDE
Shared instance of the component restriction that hides a component
-
DISABLE_SCRIPTS
public static final ComponentRestriction DISABLE_SCRIPTS
Shared instance of the component restriction that disables event scripts
-
ACCESS_DENIED_OVERLAY
public static final ComponentRestriction ACCESS_DENIED_OVERLAY
Shared instance of the component restriction that displays an opaque access denied overlay
-
DEFAULT_PERMISSIONS
public static final ComponentPermissions DEFAULT_PERMISSIONS
-
-
Constructor Detail
-
ComponentPermissions
public ComponentPermissions()
For serialization only.
-
ComponentPermissions
public ComponentPermissions(ComponentPermissions copy)
-
ComponentPermissions
public ComponentPermissions(boolean inheritPermissions, java.lang.String[] requiredRoles, ComponentRestriction[] restrictions)
-
ComponentPermissions
public ComponentPermissions(SecuritySettings legacy)
Creates a component permissions object based on a legacy SecuritySetttings object
-
-
Method Detail
-
get
public static ComponentPermissions get(javax.swing.JComponent component)
Fetch the security settings for this component. If none have been set, a default configuration will be returned. This function automatically converts the legacy style SecuritySettings into a ComponentPermissions object.
-
set
public static void set(javax.swing.JComponent component, ComponentPermissions permissions)
Set the permissions on a component.
-
toJson
public com.inductiveautomation.ignition.common.gson.JsonElement toJson()
-
fromJson
public static ComponentPermissions fromJson(com.inductiveautomation.ignition.common.gson.JsonElement json)
-
hasAccess
public 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. Only checks if inherit=false, that is, doesn't implement inheritance checking
-
createInvertedCopy
public ComponentPermissions createInvertedCopy(java.util.List<java.lang.String> roles)
-
isInvertRoles
public boolean isInvertRoles()
-
setInvertRoles
public void setInvertRoles(boolean invertRoles)
-
isInheritPermissions
public boolean isInheritPermissions()
-
setInheritPermissions
public void setInheritPermissions(boolean inheritPermissions)
-
getRequiredRoles
public java.lang.String[] getRequiredRoles()
-
setRequiredRoles
public void setRequiredRoles(java.lang.String[] requiredRoles)
-
getRestrictions
public ComponentRestriction[] getRestrictions()
-
setRestrictions
public void setRestrictions(ComponentRestriction[] restrictions)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-