Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLinkedToUser = errors.New("role is linked to user")
Functions ¶
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []Role `bson:"data" json:"data"` TotalCount int64 `bson:"total_count" json:"total_count"` }
func (*AggregationResult) GetData ¶
func (r *AggregationResult) GetData() interface{}
func (*AggregationResult) GetTotal ¶
func (r *AggregationResult) GetTotal() int64
type CreateRequest ¶
type CreateRequest struct { EditRequest Name string `json:"name" binding:"required,max=255"` }
type EditRequest ¶
type ListRequest ¶
type ListRequest struct { pagination.FilteredQuery SortBy string `form:"sort_by" binding:"oneoforempty=name"` }
type Permission ¶
type Role ¶
type Role struct { ID string `bson:"_id" json:"_id"` Name string `bson:"name" json:"name"` Description string `bson:"description" json:"description"` DefaultView *struct { ID string `bson:"_id" json:"_id"` Title string `bson:"title" json:"title"` } `bson:"defaultview" json:"defaultview"` Permissions []Permission `bson:"permissions" json:"permissions"` }
type Store ¶
type Store interface { Find(ListRequest) (*AggregationResult, error) GetOneBy(string) (*Role, error) Insert(CreateRequest) (*Role, error) Update(string, EditRequest) (*Role, error) Delete(string) (bool, error) }
Click to show internal directories.
Click to hide internal directories.