Class ComponentPermissions
java.lang.Object
com.inductiveautomation.vision.api.client.components.model.security.ComponentPermissions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ComponentRestriction
Shared instance of the component restriction that displays an opaque access denied overlaystatic final ComponentPermissions
static final ComponentRestriction
Shared instance of the component restriction that disables a componentstatic final ComponentRestriction
Shared instance of the component restriction that disables event scriptsstatic final ComponentRestriction
Shared instance of the component restriction that hides a component -
Constructor Summary
ConstructorsConstructorDescriptionFor serialization only.ComponentPermissions
(boolean inheritPermissions, String[] requiredRoles, ComponentRestriction[] restrictions) ComponentPermissions
(SecuritySettings legacy) Creates a component permissions object based on a legacy SecuritySetttings object -
Method Summary
Modifier and TypeMethodDescriptioncreateInvertedCopy
(List<String> roles) boolean
static ComponentPermissions
fromJson
(com.inductiveautomation.ignition.common.gson.JsonElement json) static ComponentPermissions
get
(JComponent component) Fetch the security settings for this component.String[]
boolean
Checks whether or not a user with the given roles has access according to the permissions represented by this object.boolean
boolean
static void
set
(JComponent component, ComponentPermissions permissions) Set the permissions on a component.void
setInheritPermissions
(boolean inheritPermissions) void
setInvertRoles
(boolean invertRoles) void
setRequiredRoles
(String[] requiredRoles) void
setRestrictions
(ComponentRestriction[] restrictions) com.inductiveautomation.ignition.common.gson.JsonElement
toJson()
-
Field Details
-
DISABLE
Shared instance of the component restriction that disables a component -
HIDE
Shared instance of the component restriction that hides a component -
DISABLE_SCRIPTS
Shared instance of the component restriction that disables event scripts -
ACCESS_DENIED_OVERLAY
Shared instance of the component restriction that displays an opaque access denied overlay -
DEFAULT_PERMISSIONS
-
-
Constructor Details
-
ComponentPermissions
public ComponentPermissions()For serialization only. -
ComponentPermissions
-
ComponentPermissions
public ComponentPermissions(boolean inheritPermissions, String[] requiredRoles, ComponentRestriction[] restrictions) -
ComponentPermissions
Creates a component permissions object based on a legacy SecuritySetttings object
-
-
Method Details
-
get
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
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
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
-
isInvertRoles
public boolean isInvertRoles() -
setInvertRoles
public void setInvertRoles(boolean invertRoles) -
isInheritPermissions
public boolean isInheritPermissions() -
setInheritPermissions
public void setInheritPermissions(boolean inheritPermissions) -
getRequiredRoles
-
setRequiredRoles
-
getRestrictions
-
setRestrictions
-
equals
-