derwolfe
11/09/2021, 4:38 AMJake
11/09/2021, 2:24 PMin east-1
something intrinsic to the requirements to view doc or is that just another attribute you want to check about the application?Jake
11/09/2021, 2:25 PMeast-1
?Jake
11/09/2021, 2:34 PMJake
11/09/2021, 2:34 PMdoes us-east-1 contain app1
and also does app1 have view permission on doc1
then those would be different checksJake
11/09/2021, 2:35 PMderwolfe
11/09/2021, 3:01 PMderwolfe
11/09/2021, 3:04 PMJake
11/09/2021, 3:05 PMJake
11/09/2021, 3:07 PMderwolfe
11/09/2021, 3:07 PMDefinitelyNotSam
11/09/2021, 5:14 PMvroldanbet
11/10/2021, 12:16 PMdefinition user {}
definition allusers {
relation member: user
}
definition video {
relation viewer: user
relation public: allusers
permission view: user | public -> member
}
allusers:0#member@user:userA
video:X#public@allusers:0
if authzed.check(video(βxβ).view, userA):
...
Tradeoff:
- data redundancy: a relation must be added for each new user in the system
- anonymous users need to be modelled as a singleton userecordell
11/10/2021, 1:26 PMall
group (i.e. rename "allusers" to "group" and you can make all the same checks, but now it's not a singleton type)vroldanbet
11/10/2021, 1:32 PMJake
11/10/2021, 1:32 PMvroldanbet
11/10/2021, 1:45 PMDefinitelyNotSam
11/10/2021, 1:45 PMJake
11/10/2021, 1:46 PMDefinitelyNotSam
11/10/2021, 1:51 PM{
ResourceType: Client,
ResourceID: "test_client1",
Relation: ClientRelationAdmin,
SubjectType: User,
SubjectID: "test_user1",
}
When deleting this relation I am passing all of this info. The only part that I am iffy on is I include the relation type in the RelationshipFilter.OptionalRelation
field not the SubjectFilter.OptionalRelation
Am I missing somethingJake
11/10/2021, 1:53 PMDefinitelyNotSam
11/10/2021, 1:53 PMJake
11/10/2021, 1:53 PMDefinitelyNotSam
11/10/2021, 1:53 PMDefinitelyNotSam
11/10/2021, 1:54 PM// create base request with default options (optional fields here are strings; they can be filled even if they were not passed)
req := pb.RelationshipFilter{
ResourceType: string(relation.ResourceType),
OptionalResourceId: relation.ResourceID,
OptionalRelation: string(relation.Relation),
}
// conditionally include a subject filter if values were passed
if relation.SubjectType != "" {
// include the subject information
req.OptionalSubjectFilter = &pb.SubjectFilter{
SubjectType: string(relation.SubjectType),
OptionalSubjectId: relation.SubjectID,
}
}
// execute permission removal call
res, err := db.DB.DeleteRelationships(context.TODO(), &pb.DeleteRelationshipsRequest{ RelationshipFilter: &req })
DefinitelyNotSam
11/10/2021, 1:55 PMrelation
in this code block is the above struct that I sent