Class ComponentPermissions


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

      • ComponentPermissions

        public ComponentPermissions()
        For serialization only.
      • 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)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object