Documentation ¶
Overview ¶
Package permission handles API calls and persistence for spaces. Spaces in Documize contain documents.
Index ¶
- func CanChangeDocument(ctx domain.RequestContext, s domain.Store, documentID string) bool
- func CanDeleteDocument(ctx domain.RequestContext, s domain.Store, documentID string) bool
- func CanUploadDocument(ctx domain.RequestContext, s domain.Store, spaceID string) bool
- func CanViewDocument(ctx domain.RequestContext, s domain.Store, documentID string) bool
- func CanViewSpace(ctx domain.RequestContext, s domain.Store, spaceID string) bool
- func CanViewSpaceDocument(ctx domain.RequestContext, s domain.Store, labelID string) bool
- func HasPermission(ctx domain.RequestContext, s domain.Store, spaceID string, ...) bool
- type Handler
- func (h *Handler) GetCategoryPermissions(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetCategoryViewers(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetSpacePermissions(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetUserSpacePermissions(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetCategoryPermissions(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetSpacePermissions(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanChangeDocument ¶
CanChangeDocument returns if the clinet has permission to change a given document.
func CanDeleteDocument ¶
CanDeleteDocument returns if the clinet has permission to change a given document.
func CanUploadDocument ¶
CanUploadDocument returns if the client has permission to upload documents to the given space.
func CanViewDocument ¶
CanViewDocument returns if the client has permission to view a given document.
func CanViewSpace ¶
CanViewSpace returns if the user has permission to view the given spaceID.
func CanViewSpaceDocument ¶
CanViewSpaceDocument returns if the user has permission to view a document within the specified folder.
func HasPermission ¶
func HasPermission(ctx domain.RequestContext, s domain.Store, spaceID string, actions ...pm.Action) bool
HasPermission returns if user can perform specified actions.
Types ¶
type Handler ¶
Handler contains the runtime information such as logging and database.
func (*Handler) GetCategoryPermissions ¶
func (h *Handler) GetCategoryPermissions(w http.ResponseWriter, r *http.Request)
GetCategoryPermissions returns user permissions for given category.
func (*Handler) GetCategoryViewers ¶
func (h *Handler) GetCategoryViewers(w http.ResponseWriter, r *http.Request)
GetCategoryViewers returns user permissions for given category.
func (*Handler) GetSpacePermissions ¶
func (h *Handler) GetSpacePermissions(w http.ResponseWriter, r *http.Request)
GetSpacePermissions returns permissions for all users for given space.
func (*Handler) GetUserSpacePermissions ¶
func (h *Handler) GetUserSpacePermissions(w http.ResponseWriter, r *http.Request)
GetUserSpacePermissions returns permissions for the requested space, for current user.
func (*Handler) SetCategoryPermissions ¶
func (h *Handler) SetCategoryPermissions(w http.ResponseWriter, r *http.Request)
SetCategoryPermissions persists specified category permissions
func (*Handler) SetSpacePermissions ¶
func (h *Handler) SetSpacePermissions(w http.ResponseWriter, r *http.Request)
SetSpacePermissions persists specified space permissions