Documentation ¶
Overview ¶
Package mysql handles data persistence for space and document permissions.
Index ¶
- type Scope
- func (s Scope) AddPermission(ctx domain.RequestContext, r permission.Permission) (err error)
- func (s Scope) AddPermissions(ctx domain.RequestContext, r permission.Permission, ...) (err error)
- func (s Scope) DeleteCategoryPermissions(ctx domain.RequestContext, categoryID string) (rows int64, err error)
- func (s Scope) DeleteSpaceCategoryPermissions(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) DeleteSpacePermissions(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) DeleteUserPermissions(ctx domain.RequestContext, userID string) (rows int64, err error)
- func (s Scope) DeleteUserSpacePermissions(ctx domain.RequestContext, spaceID, userID string) (rows int64, err error)
- func (s Scope) GetCategoryPermissions(ctx domain.RequestContext, catID string) (r []permission.Permission, err error)
- func (s Scope) GetCategoryUsers(ctx domain.RequestContext, catID string) (u []user.User, err error)
- func (s Scope) GetSpacePermissions(ctx domain.RequestContext, spaceID string) (r []permission.Permission, err error)
- func (s Scope) GetUserCategoryPermissions(ctx domain.RequestContext, userID string) (r []permission.Permission, err error)
- func (s Scope) GetUserSpacePermissions(ctx domain.RequestContext, spaceID string) (r []permission.Permission, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
Scope provides data access to MySQL.
func (Scope) AddPermission ¶
func (s Scope) AddPermission(ctx domain.RequestContext, r permission.Permission) (err error)
AddPermission inserts the given record into the permisssion table.
func (Scope) AddPermissions ¶
func (s Scope) AddPermissions(ctx domain.RequestContext, r permission.Permission, actions ...permission.Action) (err error)
AddPermissions inserts records into permission database table, one per action.
func (Scope) DeleteCategoryPermissions ¶
func (s Scope) DeleteCategoryPermissions(ctx domain.RequestContext, categoryID string) (rows int64, err error)
DeleteCategoryPermissions removes records from permissions table for given category ID.
func (Scope) DeleteSpaceCategoryPermissions ¶
func (s Scope) DeleteSpaceCategoryPermissions(ctx domain.RequestContext, spaceID string) (rows int64, err error)
DeleteSpaceCategoryPermissions removes all category permission for for given space.
func (Scope) DeleteSpacePermissions ¶
func (s Scope) DeleteSpacePermissions(ctx domain.RequestContext, spaceID string) (rows int64, err error)
DeleteSpacePermissions removes records from permissions table for given space ID.
func (Scope) DeleteUserPermissions ¶
func (s Scope) DeleteUserPermissions(ctx domain.RequestContext, userID string) (rows int64, err error)
DeleteUserPermissions removes all roles for the specified user, for the specified space.
func (Scope) DeleteUserSpacePermissions ¶
func (s Scope) DeleteUserSpacePermissions(ctx domain.RequestContext, spaceID, userID string) (rows int64, err error)
DeleteUserSpacePermissions removes all roles for the specified user, for the specified space.
func (Scope) GetCategoryPermissions ¶
func (s Scope) GetCategoryPermissions(ctx domain.RequestContext, catID string) (r []permission.Permission, err error)
GetCategoryPermissions returns category permissions for all users.
func (Scope) GetCategoryUsers ¶
GetCategoryUsers returns space permissions for all users.
func (Scope) GetSpacePermissions ¶
func (s Scope) GetSpacePermissions(ctx domain.RequestContext, spaceID string) (r []permission.Permission, err error)
GetSpacePermissions returns space permissions for all users.
func (Scope) GetUserCategoryPermissions ¶
func (s Scope) GetUserCategoryPermissions(ctx domain.RequestContext, userID string) (r []permission.Permission, err error)
GetUserCategoryPermissions returns category permissions for given user.
func (Scope) GetUserSpacePermissions ¶
func (s Scope) GetUserSpacePermissions(ctx domain.RequestContext, spaceID string) (r []permission.Permission, err error)
GetUserSpacePermissions returns space permissions for user. Context is used to for user ID.