Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Count(ctx context.Context) (int64, error) GetAll(ctx context.Context) ([]*Role, error) GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*Role, error) GetByID(ctx context.Context, id int64) (*Role, error) CreateOrUpdate(ctx context.Context, role *Role) error Create(ctx context.Context, upload *Role) error Update(ctx context.Context, upload *Role) error Delete(ctx context.Context, id int64) error }
type Role ¶
type Role struct { ID uint Name string Description string Permissions []permission.Permission CreatedAt time.Time UpdatedAt time.Time }
func (*Role) AddPermission ¶
func (r *Role) AddPermission(p permission.Permission) *Role
func (*Role) Can ¶
func (r *Role) Can(perm permission.Permission) bool
Click to show internal directories.
Click to hide internal directories.