1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

Replace permission related strings with typed values

This commit is contained in:
sauls8t 2018-03-02 14:47:58 +00:00
parent 99f0a16d71
commit 08f0c2cd0b
8 changed files with 72 additions and 58 deletions

View file

@ -118,12 +118,12 @@ func HasAnyPermission(p Record) bool {
func EncodeRecord(r Record, a Action) (p Permission) {
p = Permission{}
p.OrgID = r.OrgID
p.Who = "user"
p.Who = UserPermission
p.WhoID = r.UserID
p.Location = "space"
p.Location = LocationSpace
p.RefID = r.SpaceID
p.Action = a
p.Scope = "object" // default to row level permission
p.Scope = ScopeRow
return
}