Documentation ¶
Index ¶
- Variables
- type ObjectID
- type PermissionType
- type Permissions
- func (p *Permissions) BackupTo(bkpDest string) error
- func (p *Permissions) CheckPermissionAny(objID, usrID string, permissions ...PermissionType) (bool, error)
- func (p *Permissions) DeletePermission(objID, usrID string, permission PermissionType) error
- func (p *Permissions) GetAllAsMap() (map[string](map[string](map[PermissionType]bool)), error)
- func (p *Permissions) RemoveUsersPermissions(usrID string) error
- func (p *Permissions) SetPermission(objID, usrID string, permission PermissionType, value bool) error
- type UserID
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type PermissionType ¶
type PermissionType int8
const ( Create PermissionType = 0 Read PermissionType = 1 Update PermissionType = 2 Delete PermissionType = 3 CRUD PermissionType = 4 )
type Permissions ¶
func NewPermissions ¶
func NewPermissions(dir string) (*Permissions, error)
func (*Permissions) BackupTo ¶
func (p *Permissions) BackupTo(bkpDest string) error
func (*Permissions) CheckPermissionAny ¶
func (p *Permissions) CheckPermissionAny(objID, usrID string, permissions ...PermissionType) (bool, error)
func (*Permissions) DeletePermission ¶
func (p *Permissions) DeletePermission(objID, usrID string, permission PermissionType) error
func (*Permissions) GetAllAsMap ¶
func (p *Permissions) GetAllAsMap() (map[string](map[string](map[PermissionType]bool)), error)
func (*Permissions) RemoveUsersPermissions ¶
func (p *Permissions) RemoveUsersPermissions(usrID string) error
func (*Permissions) SetPermission ¶
func (p *Permissions) SetPermission(objID, usrID string, permission PermissionType, value bool) error
Click to show internal directories.
Click to hide internal directories.