Permission

package
v0.0.0-...-6947385 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	Id          Type.GormUlid `json:"id" gorm:"primaryKey;size:26;not null"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	CreatedAt   time.Time     `json:"created_at"`
	ModifiedAt  time.Time     `json:"modified_at"`
}

func Define

func Define(id ulid.ULID, name string, description string) *Permission

func (*Permission) UpdateDescription

func (p *Permission) UpdateDescription(description string)

func (*Permission) UpdateName

func (p *Permission) UpdateName(name string)

type PermissionRepository

type PermissionRepository interface {
	GetById(id ulid.ULID) (*Permission, error)
	GetByName(name string) (*Permission, error)
	// TODO: Include pagination
	GetAll() (*[]Permission, error)
	Add(permission *Permission) error
	Remove(permission *Permission) error
	UpdateOrAdd(permission *Permission) error
}

Jump to

Keyboard shortcuts

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