mysql

package
v1.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mysql handles data persistence for space and document permissions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	Runtime *env.Runtime
}

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

func (s Scope) GetCategoryUsers(ctx domain.RequestContext, catID string) (u []user.User, err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL