sul3
01/31/2024, 12:22 PMvroldanbet
01/31/2024, 1:16 PMobject:potato#parent@user:jane
- object
is the resource's object_type
- potato
is the resource's object_id
- parent
is the resources relation
- user
is the subject's object_type
- jane
is the subject's object_id
so you will end up create a https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.PermissionsService.WriteRelationships request that looks like this (pseudonotation)
WriteRelationshipsRequest {
updates: [
{
operation: "touch",
relationship: {
resource: {
object_type: "object",
object_id: "potato",
},
relation: "parent",
subject: {
object {
object_type: "user",
object_id: "jane",
}
}
}
}]
}
sul3
01/31/2024, 1:35 PMobject:someObject#parent@object:potato#parent
sul3
01/31/2024, 1:36 PMvroldanbet
01/31/2024, 1:37 PMSubjectReference
?vroldanbet
01/31/2024, 1:38 PMsul3
01/31/2024, 1:58 PMjava
PermissionService.WriteRelationshipsRequest request = PermissionService.WriteRelationshipsRequest.newBuilder()
.addUpdates(
RelationshipUpdate.newBuilder()
.setOperation(RelationshipUpdate.Operation.OPERATION_CREATE)
.setRelationship(
Relationship.newBuilder()
.setResource(
ObjectReference.newBuilder()
.setObjectType("tutorial/file")
.setObjectId("test5")
.build())
.setRelation("editor")
.setSubject(
SubjectReference.newBuilder()
.setObject(
ObjectReference.newBuilder()
.setObjectType("tutorial/group")
.setObjectId("architecture_infrastructure")
> .build())
.build())
.build())
.build())
.build();
to this I would like to add the argument of relationship, but I can't find a function that allows me to set it.sul3
01/31/2024, 1:59 PMsul3
01/31/2024, 2:00 PMyetitwo
01/31/2024, 2:08 PMoptional_subject_relation
yetitwo
01/31/2024, 2:11 PMsul3
01/31/2024, 2:12 PMsul3
01/31/2024, 2:12 PMyetitwo
01/31/2024, 2:15 PM