permission

package
v0.0.0-...-bea25b7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	List(c *gin.Context)
}

func NewApi

func NewApi(
	store Store,
) API

type AggregationResult

type AggregationResult struct {
	Data       []Permission `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 Group

type Group struct {
	ID       string `bson:"_id" json:"_id"`
	Name     string `bson:"name" json:"name"`
	Title    string `bson:"title" json:"title"`
	Position int64  `bson:"position" json:"position"`
}

type ListRequest

type ListRequest struct {
	pagination.FilteredQuery
}

type Permission

type Permission struct {
	ID          string  `bson:"_id" json:"_id"`
	Name        string  `bson:"name" json:"name"`
	Title       string  `bson:"title" json:"title"`
	Description string  `bson:"description" json:"description"`
	Type        string  `bson:"type" json:"type"`
	Groups      []Group `bson:"groups" json:"groups"`
}

type Store

type Store interface {
	Find(ctx context.Context, request ListRequest) (*AggregationResult, error)
}

func NewStore

func NewStore(dbClient mongo.DbClient) Store

Jump to

Keyboard shortcuts

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