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 ComponentRestrictionACCESS_DENIED_OVERLAYShared instance of the component restriction that displays an opaque access denied overlaystatic ComponentPermissionsDEFAULT_PERMISSIONSstatic ComponentRestrictionDISABLEShared instance of the component restriction that disables a componentstatic ComponentRestrictionDISABLE_SCRIPTSShared instance of the component restriction that disables event scriptsstatic ComponentRestrictionHIDEShared 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 ComponentPermissionscreateInvertedCopy(java.util.List<java.lang.String> roles)booleanequals(java.lang.Object obj)static ComponentPermissionsfromJson(com.inductiveautomation.ignition.common.gson.JsonElement json)static ComponentPermissionsget(javax.swing.JComponent component)Fetch the security settings for this component.java.lang.String[]getRequiredRoles()ComponentRestriction[]getRestrictions()booleanhasAccess(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.booleanisInheritPermissions()booleanisInvertRoles()static voidset(javax.swing.JComponent component, ComponentPermissions permissions)Set the permissions on a component.voidsetInheritPermissions(boolean inheritPermissions)voidsetInvertRoles(boolean invertRoles)voidsetRequiredRoles(java.lang.String[] requiredRoles)voidsetRestrictions(ComponentRestriction[] restrictions)com.inductiveautomation.ignition.common.gson.JsonElementtoJson()
-
-
-
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:
equalsin classjava.lang.Object
-
-