Skip to content

Commit

Permalink
Fix setting the user and group ids in the grants created from an ace
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Mar 11, 2021
1 parent 39e04dc commit 0c96aae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/storage/utils/ace/ace.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ func (e *ACE) Grant() *provider.Grant {
},
Permissions: e.grantPermissionSet(),
}
id := e.principal[2:]
if e.granteeType() == provider.GranteeType_GRANTEE_TYPE_GROUP {
g.Grantee.Id = &provider.Grantee_GroupId{GroupId: &grouppb.GroupId{OpaqueId: e.principal}}
g.Grantee.Id = &provider.Grantee_GroupId{GroupId: &grouppb.GroupId{OpaqueId: id}}
} else if e.granteeType() == provider.GranteeType_GRANTEE_TYPE_USER {
g.Grantee.Id = &provider.Grantee_UserId{UserId: &userpb.UserId{OpaqueId: e.principal}}
g.Grantee.Id = &provider.Grantee_UserId{UserId: &userpb.UserId{OpaqueId: id}}
}
return g
}
Expand Down

0 comments on commit 0c96aae

Please sign in to comment.