mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Replace permission related strings with typed values
This commit is contained in:
parent
99f0a16d71
commit
08f0c2cd0b
8 changed files with 72 additions and 58 deletions
|
@ -67,12 +67,12 @@ func HasAnyDocumentPermission(p DocumentRecord) bool {
|
|||
func EncodeDocumentRecord(r DocumentRecord, a Action) (p Permission) {
|
||||
p = Permission{}
|
||||
p.OrgID = r.OrgID
|
||||
p.Who = "user"
|
||||
p.Who = UserPermission
|
||||
p.WhoID = r.UserID
|
||||
p.Location = "document"
|
||||
p.Location = LocationDocument
|
||||
p.RefID = r.DocumentID
|
||||
p.Action = a
|
||||
p.Scope = "object" // default to row level permission
|
||||
p.Scope = ScopeRow
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue