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

category permission admin, re-vamped view layout

This commit is contained in:
Harvey Kandola 2017-09-21 15:48:00 +01:00
parent 0c152c219f
commit 3f31d6d15e
48 changed files with 753 additions and 373 deletions

View file

@ -16,7 +16,7 @@ import "time"
// Permission represents a permission for a space and is persisted to the database.
type Permission struct {
ID uint64 `json:"id"`
OrgID string `json:"-"`
OrgID string `json:"orgId"`
Who string `json:"who"` // user, role
WhoID string `json:"whoId"` // either a user or role ID
Action Action `json:"action"` // view, edit, delete
@ -49,6 +49,9 @@ const (
DocumentCopy Action = "doc-copy"
// DocumentTemplate means you can create, edit and delete document templates and content blocks
DocumentTemplate Action = "doc-template"
// CategoryView action means you can view a category and documents therein
CategoryView Action = "view"
)
// Record represents space permissions for a user on a space.
@ -178,3 +181,11 @@ func EncodeRecord(r Record, a Action) (p Permission) {
return
}
// CategoryViewRequestModel represents who should be allowed to see a category.
type CategoryViewRequestModel struct {
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
CategoryID string `json:"categoryID"`
UserID string `json:"userId"`
}