Record Class SubjectContext
java.lang.Object
java.lang.Record
org.openmetadata.service.security.policyevaluator.SubjectContext
Subject context used for Access Control Policies
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSubjectContext(User user) Creates an instance of aSubjectContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Iterator<org.openmetadata.service.security.policyevaluator.SubjectContext.PolicyContext>getPolicies(EntityReference resourceOwner) static List<EntityReference>getRolesForTeams(List<EntityReference> teams) static SubjectContextgetSubjectContext(String userName) getTeams()booleanhasAnyRole(String roles) Returns true if the user has any of the roles (either direct or inherited roles)final inthashCode()Returns a hash code value for this object.static booleanReturn true if the given user has any roles the list of rolesbooleanisAdmin()booleanisBot()static booleanisInTeam(String parentTeam, EntityReference team) Return true if the team is part of the hierarchy of parentTeambooleanisOwner(EntityReference owner) booleanisTeamAsset(String parentTeam, EntityReference owner) Returns true if the given resource owner is under the team hierarchy of parentTeambooleanisUserUnderTeam(String parentTeam) Returns true if the user of this SubjectContext is under the team hierarchy of parentTeamfinal StringtoString()Returns a string representation of this record class.user()Returns the value of theuserrecord component.
-
Field Details
-
TEAM_FIELDS
- See Also:
-
-
Constructor Details
-
SubjectContext
Creates an instance of aSubjectContextrecord class.- Parameters:
user- the value for theuserrecord component
-
-
Method Details
-
getSubjectContext
-
isAdmin
public boolean isAdmin() -
isBot
public boolean isBot() -
isOwner
-
isUserUnderTeam
Returns true if the user of this SubjectContext is under the team hierarchy of parentTeam -
isTeamAsset
Returns true if the given resource owner is under the team hierarchy of parentTeam -
isInTeam
Return true if the team is part of the hierarchy of parentTeam -
getRolesForTeams
-
getPolicies
public Iterator<org.openmetadata.service.security.policyevaluator.SubjectContext.PolicyContext> getPolicies(EntityReference resourceOwner) -
getTeams
-
hasAnyRole
Returns true if the user has any of the roles (either direct or inherited roles) -
hasRole
Return true if the given user has any roles the list of roles -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
user
Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-