controller

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePermissionsMap added in v0.0.15

func ComputePermissionsMap(token jwt.Token, resource model.Resource, defaultPerm model.ResourcePermissions) (result model.PermissionsMap)

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewWithDependencies

func NewWithDependencies(ctx context.Context, config configuration.Config, db DB, producerProvider kafka.Provider) (*Controller, error)

func (*Controller) AdminListResourceIds added in v0.0.9

func (this *Controller) AdminListResourceIds(tokenStr string, topicId string, options model.ListOptions) (ids []string, err error, code int)

func (*Controller) AdminLoadFromPermissionSearch added in v0.0.27

func (this *Controller) AdminLoadFromPermissionSearch(req model.AdminLoadPermSearchRequest) (updateCount int, err error, code int)

func (*Controller) CheckMultiplePermissions

func (this *Controller) CheckMultiplePermissions(tokenStr string, topicId string, ids []string, permissions ...model.Permission) (accessMap map[string]bool, err error, code int)

func (*Controller) CheckPermission

func (this *Controller) CheckPermission(tokenStr string, topicId string, id string, permissions ...model.Permission) (access bool, err error, code int)

func (*Controller) CheckTopicDefaultPermission added in v0.0.18

func (this *Controller) CheckTopicDefaultPermission(token jwt.Token, topicId string, permissions model.PermissionList) (access bool, err error, code int)

func (*Controller) GetResource

func (this *Controller) GetResource(tokenStr string, topicId string, id string) (result model.Resource, err error, code int)

func (*Controller) GetTopic

func (this *Controller) GetTopic(tokenStr string, id string) (result model.Topic, err error, code int)

func (*Controller) ListAccessibleResourceIds

func (this *Controller) ListAccessibleResourceIds(tokenStr string, topicId string, options model.ListOptions, permission ...model.Permission) (ids []string, err error, code int)

func (*Controller) ListComputedPermissions added in v0.0.15

func (this *Controller) ListComputedPermissions(tokenStr string, topicId string, ids []string) (result []model.ComputedPermissions, err error, code int)

func (*Controller) ListResourcesWithAdminPermission

func (this *Controller) ListResourcesWithAdminPermission(tokenStr string, topicId string, options model.ListOptions) (result []model.Resource, err error, code int)

func (*Controller) ListTopics

func (this *Controller) ListTopics(tokenStr string, options model.ListOptions) (result []model.Topic, err error, code int)

func (*Controller) RemoveResource added in v0.0.5

func (this *Controller) RemoveResource(tokenStr string, topicId string, id string) (err error, code int)

func (*Controller) RemoveTopic

func (this *Controller) RemoveTopic(tokenStr string, id string) (err error, code int)

func (*Controller) RetryPublishOfUnsyncedResources added in v0.0.16

func (this *Controller) RetryPublishOfUnsyncedResources() error

func (*Controller) SetPermission

func (this *Controller) SetPermission(tokenStr string, topicId string, id string, permissions model.ResourcePermissions) (result model.ResourcePermissions, err error, code int)

func (*Controller) SetTopic

func (this *Controller) SetTopic(tokenStr string, topic model.Topic) (result model.Topic, err error, code int)

func (*Controller) StartSyncLoop added in v0.0.16

func (this *Controller) StartSyncLoop(ctx context.Context)

type DB

type DB = database.Database

type LogNotifier

type LogNotifier struct{}

func (LogNotifier) SendMessage

func (this LogNotifier) SendMessage(message client.Message) error

type PermissionSearchResponseElement added in v0.0.27

type PermissionSearchResponseElement struct {
	UserRights  map[string]PermissionSearchResponseElementRight `json:"user_rights"`
	GroupRights map[string]PermissionSearchResponseElementRight `json:"group_rights"`
	ResourceId  string                                          `json:"resource_id"`
	Creator     string                                          `json:"creator"`
}

type PermissionSearchResponseElementRight added in v0.0.27

type PermissionSearchResponseElementRight struct {
	Read         bool `json:"read"`
	Write        bool `json:"write"`
	Execute      bool `json:"execute"`
	Administrate bool `json:"administrate"`
}

type User added in v0.0.21

type User struct {
	Id   string `json:"id"`
	Name string `json:"username"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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