mysql

package
v1.65.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2018 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) DeleteDocumentPermissions added in v1.56.0

func (s Scope) DeleteDocumentPermissions(ctx domain.RequestContext, documentID string) (rows int64, err error)

DeleteDocumentPermissions removes records from permissions table for given document.

func (Scope) DeleteGroupPermissions added in v1.58.0

func (s Scope) DeleteGroupPermissions(ctx domain.RequestContext, groupID string) (rows int64, err error)

DeleteGroupPermissions removes all roles for the specified group

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) GetDocumentPermissions added in v1.56.0

func (s Scope) GetDocumentPermissions(ctx domain.RequestContext, documentID string) (r []permission.Permission, err error)

GetDocumentPermissions returns documents permissions for all users. We do not filter by userID because we return 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. We do not filter by userID because we return 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) GetUserDocumentPermissions added in v1.56.0

func (s Scope) GetUserDocumentPermissions(ctx domain.RequestContext, documentID string) (r []permission.Permission, err error)

GetUserDocumentPermissions returns document permissions for user. Context is used to for user ID.

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 userID because must match by userID or everyone ID of 0.

Jump to

Keyboard shortcuts

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