java.lang.Object
com.inductiveautomation.ignition.common.tags.model.SecurityContext
All Implemented Interfaces:
Serializable

public abstract class SecurityContext extends Object implements Serializable
Encapsulates contextual security information about the current user of the tag system
See Also:
  • Field Details

  • Method Details

    • getRoles

      public abstract com.google.common.collect.ImmutableCollection<String> getRoles()
      Returns:
      the user's roles in this context
    • getSecurityZones

      public abstract com.google.common.collect.ImmutableCollection<String> getSecurityZones()
      Returns:
      the user's security zones in this context
    • getSecurityLevels

      public abstract com.google.common.collect.ImmutableCollection<SecurityLevelConfig> getSecurityLevels()
      Returns:
      the user's security levels in this context
    • getTagReferencePath

      public abstract com.inductiveautomation.ignition.common.tags.config.model.TagReferencePath getTagReferencePath()
    • replaceTagReferencePath

      public abstract SecurityContext replaceTagReferencePath(@Nullable com.inductiveautomation.ignition.common.tags.config.model.TagReferencePath trace)
    • addTagReferencePath

      public SecurityContext addTagReferencePath(com.inductiveautomation.ignition.common.tags.config.model.TagReferenceLocation path)
    • isSystem

      public abstract boolean isSystem()
      Returns:
      If true, this indicates to the tag system that a tag write is originating from the gateway, and there is no relevant user info. Examples include gateway tag event scripts and tag writes from SFCs.
    • fromSecurityLevels

      public static SecurityContext fromSecurityLevels(com.google.common.collect.ImmutableCollection<SecurityLevelConfig> securityLevels)
      Create a SecurityContext from the given ImmutableCollection of SecurityLevelConfigs representing the children of the root public security level
      Parameters:
      securityLevels - the security level tree node children of the root public security level
      Returns:
      a new SecurityContext containing the given security level tree nodes
    • fromRolesAndZones

      public static SecurityContext fromRolesAndZones(com.google.common.collect.ImmutableCollection<String> roles, com.google.common.collect.ImmutableCollection<String> zones)
      Create a SecurityContext from the given ImmutableCollections of roles and zones.
      Parameters:
      roles - the roles assigned to the current users
      zones - the security zones assigned to the current user
      Returns:
      a new SecurityContext containing the given roles and zones
    • fromAuthenticatedUser

      public static SecurityContext fromAuthenticatedUser(AuthenticatedUser user)
      Create a SecurityContext from the given AuthenticatedUser.
      Parameters:
      user - the currently authenticated user
      Returns:
      a new SecurityContext containing the given user's roles and zones
    • emptyContext

      public static SecurityContext emptyContext()
      Returns:
      A SecurityContext without any security level, roles or zones set. Use when no authenticated user is present.
    • systemContext

      public static SecurityContext systemContext()
      Returns:
      A SecurityContext without any security level, roles or zones set, but the isSystem flag is set to true. This indicates to the tag system that a tag write is originating from the gateway, and there is no relevant user info. Examples include gateway tag event scripts and tag writes from SFCs.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object