Class SecurityContext
java.lang.Object
com.inductiveautomation.ignition.common.tags.model.SecurityContext
- All Implemented Interfaces:
Serializable
Encapsulates contextual security information about the current user of the tag system
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddTagReferencePath
(com.inductiveautomation.ignition.common.tags.config.model.TagReferenceLocation path) static SecurityContext
boolean
static SecurityContext
Create aSecurityContext
from the givenAuthenticatedUser
.static SecurityContext
fromRolesAndZones
(com.google.common.collect.ImmutableCollection<String> roles, com.google.common.collect.ImmutableCollection<String> zones) Create aSecurityContext
from the givenImmutableCollection
s of roles and zones.static SecurityContext
fromSecurityLevels
(com.google.common.collect.ImmutableCollection<SecurityLevelConfig> securityLevels) Create aSecurityContext
from the givenImmutableCollection
ofSecurityLevelConfig
s representing the children of the root public security levelabstract com.google.common.collect.ImmutableCollection<String>
getRoles()
abstract com.google.common.collect.ImmutableCollection<SecurityLevelConfig>
abstract com.google.common.collect.ImmutableCollection<String>
abstract com.inductiveautomation.ignition.common.tags.config.model.TagReferencePath
int
hashCode()
abstract boolean
isSystem()
abstract SecurityContext
replaceTagReferencePath
(com.inductiveautomation.ignition.common.tags.config.model.TagReferencePath trace) static SecurityContext
toString()
-
Field Details
-
THREAD_LOCAL
-
-
Method Details
-
getRoles
- Returns:
- the user's roles in this context
-
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 aSecurityContext
from the givenImmutableCollection
ofSecurityLevelConfig
s 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 aSecurityContext
from the givenImmutableCollection
s of roles and zones.- Parameters:
roles
- the roles assigned to the current userszones
- the security zones assigned to the current user- Returns:
- a new
SecurityContext
containing the given roles and zones
-
fromAuthenticatedUser
Create aSecurityContext
from the givenAuthenticatedUser
.- Parameters:
user
- the currently authenticated user- Returns:
- a new
SecurityContext
containing the given user's roles and zones
-
emptyContext
- Returns:
- A SecurityContext without any security level, roles or zones set. Use when no authenticated user is present.
-
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
-
hashCode
public int hashCode() -
toString
-