repos

package
v0.0.0-...-8366d43 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Groups

type Groups []perm.Group

func (*Groups) GetIDs

func (g *Groups) GetIDs() []string

type HasPermissionQuery

type HasPermissionQuery struct {
	Actor           perm.Actor
	Action          string
	ResourcePattern string
	Groups          []perm.Group
}

type HasRoleForGroupQuery

type HasRoleForGroupQuery struct {
	Group    perm.Group
	RoleName string
}

type HasRoleQuery

type HasRoleQuery struct {
	Actor    perm.Actor
	RoleName string
}

type ListResourcePatternsQuery

type ListResourcePatternsQuery struct {
	Actor  perm.Actor
	Groups Groups
	Action string
}

type ListRolePermissionsQuery

type ListRolePermissionsQuery struct {
	RoleName string
}

type PermissionRepo

type PermissionRepo interface {
	HasPermission(
		ctx context.Context,
		logger logx.Logger,
		query HasPermissionQuery,
	) (bool, error)

	ListResourcePatterns(
		ctx context.Context,
		logger logx.Logger,
		query ListResourcePatternsQuery,
	) ([]string, error)
}

type RoleRepo

type RoleRepo interface {
	CreateRole(
		ctx context.Context,
		logger logx.Logger,
		name string,
		permissions ...perm.Permission,
	) (perm.Role, error)

	DeleteRole(
		context.Context,
		logx.Logger,
		string,
	) error

	ListRolePermissions(
		ctx context.Context,
		logger logx.Logger,
		query ListRolePermissionsQuery,
	) ([]perm.Permission, error)

	AssignRole(
		ctx context.Context,
		logger logx.Logger,
		roleName,
		domainID,
		namespace string,
	) error

	AssignRoleToGroup(
		ctx context.Context,
		logger logx.Logger,
		roleName,
		groupID string,
	) error

	UnassignRole(
		ctx context.Context,
		logger logx.Logger,
		roleName,
		domainID,
		namespace string,
	) error

	UnassignRoleFromGroup(
		ctx context.Context,
		logger logx.Logger,
		roleName,
		groupID string,
	) error

	HasRole(
		ctx context.Context,
		logger logx.Logger,
		query HasRoleQuery,
	) (bool, error)

	HasRoleForGroup(
		ctx context.Context,
		logger logx.Logger,
		query HasRoleForGroupQuery,
	) (bool, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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