Record Class Permission.Resource
java.lang.Object
java.lang.Record
zeroecho.pki.server.Permission.Resource
- Record Components:
type- resource typescope- exact security scopeobjectId- optional canonical object identityownerPrincipalId- optional owning principal identity
- Enclosing class:
Permission
public static record Permission.Resource(Permission.ResourceType type, Permission.Scope scope, Optional<PkiId> objectId, Optional<String> ownerPrincipalId)
extends Record
Transport-neutral target reference. Possession is never authorization.
-
Constructor Summary
ConstructorsConstructorDescriptionResource(Permission.ResourceType type, Permission.Scope scope, Optional<PkiId> objectId, Optional<String> ownerPrincipalId) Validates the finite resource reference. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.objectId()Returns the value of theobjectIdrecord component.booleanownedBy(SecurityPrincipal principal) Tests whether the principal owns this object.Returns the value of theownerPrincipalIdrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Resource
public Resource(Permission.ResourceType type, Permission.Scope scope, Optional<PkiId> objectId, Optional<String> ownerPrincipalId) Validates the finite resource reference.
-
-
Method Details
-
ownedBy
Tests whether the principal owns this object.- Parameters:
principal- principal to test- Returns:
truewhen the resource records that principal as owner
-
toString
-
hashCode
-
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). -
type
-
scope
-
objectId
-
ownerPrincipalId
Returns the value of theownerPrincipalIdrecord component.- Returns:
- the value of the
ownerPrincipalIdrecord component
-