Class ZoneRoleRequirement

java.lang.Object
com.inductiveautomation.ignition.common.user.ZoneRoleRequirement
All Implemented Interfaces:
Serializable

public class ZoneRoleRequirement extends Object implements Serializable
Represents a permission requirement, where the request must originate from a specific security zone and/or be initiated by a user which has a certain role.

Represents a Security Zone and/or a Rolename. Either may be null or blank, which indicates that permission will be granted.

See Also:
  • Constructor Details

    • ZoneRoleRequirement

      public ZoneRoleRequirement()
      Empty ctor for xml serialization
    • ZoneRoleRequirement

      public ZoneRoleRequirement(@Nullable String zone, @Nullable String role)
  • Method Details

    • getEmptyZoneRoleRequirement

      public static ZoneRoleRequirement getEmptyZoneRoleRequirement()
      Used by NamedQuery to make a default any/any security zone requirement.
      Returns:
      A new ZoneRoleRequirement with both zone and role set to null.
    • getZone

      @Nullable public String getZone()
    • setZone

      public void setZone(String zone)
    • getRole

      @Nullable public String getRole()
    • setRole

      public void setRole(String role)
    • checkAccess

      public ZoneRoleRequirement.PermissionResult checkAccess(@Nullable Collection<String> roles, @Nullable Collection<String> zones)
      Given a collection of zones and roles that are present for a request, check whether or not this requirement is satisfied.
      Parameters:
      roles - List of roles the requester has. May be null; null returns denied.
      zones - List of zones the requester is in. May be null; null should match Default.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object