role

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmptyPolicy

func NewEmptyPolicy(namespace string) *authorizationapi.Policy

Types

type REST

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

REST implements the RESTStorage interface in terms of an Registry.

func NewREST

func NewREST(registry Registry) *REST

NewREST creates a new REST for policies.

func (*REST) Create

func (r *REST) Create(ctx kapi.Context, obj runtime.Object) (runtime.Object, error)

Create registers a given new Role inside the Policy instance to r.registry.

func (*REST) Delete

func (r *REST) Delete(ctx kapi.Context, name string) (runtime.Object, error)

Delete asynchronously deletes the role specified by its name.

func (*REST) Get added in v0.4.2

func (r *REST) Get(ctx kapi.Context, name string) (runtime.Object, error)

Get obtains the role specified by its name.

func (*REST) List added in v0.4.2

func (r *REST) List(ctx kapi.Context, label labels.Selector, field fields.Selector) (runtime.Object, error)

List obtains a list of roles that match label.

func (*REST) New

func (r *REST) New() runtime.Object

New creates a new Role object

func (*REST) NewList added in v0.4.2

func (*REST) NewList() runtime.Object

func (*REST) Update

func (r *REST) Update(ctx kapi.Context, obj runtime.Object) (runtime.Object, bool, error)

Update replaces a given Role inside the Policy instance with an existing instance in r.registry.

type Registry added in v0.4.2

type Registry interface {
	// ListRoles obtains list of policyRoles that match a selector.
	ListRoles(ctx kapi.Context, label labels.Selector, field fields.Selector) (*authorizationapi.RoleList, error)
	// GetRole retrieves a specific policyRole.
	GetRole(ctx kapi.Context, id string) (*authorizationapi.Role, error)
	// CreateRole creates a new policyRole.
	CreateRole(ctx kapi.Context, policyRole *authorizationapi.Role) error
	// UpdateRole updates a policyRole.
	UpdateRole(ctx kapi.Context, policyRole *authorizationapi.Role) error
	// DeleteRole deletes a policyRole.
	DeleteRole(ctx kapi.Context, id string) error
}

Registry is an interface for things that know how to store Roles.

func NewVirtualRegistry added in v0.4.2

func NewVirtualRegistry(policyRegistry policyregistry.Registry) Registry

NewVirtualRegistry creates a new REST for policies.

type VirtualRegistry added in v0.4.2

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

func (*VirtualRegistry) CreateRole added in v0.4.2

func (m *VirtualRegistry) CreateRole(ctx kapi.Context, role *authorizationapi.Role) error

func (*VirtualRegistry) DeleteRole added in v0.4.2

func (m *VirtualRegistry) DeleteRole(ctx kapi.Context, name string) error

func (*VirtualRegistry) EnsurePolicy added in v0.4.2

func (m *VirtualRegistry) EnsurePolicy(ctx kapi.Context) (*authorizationapi.Policy, error)

EnsurePolicy returns the policy object for the specified namespace. If one does not exist, it is created for you. Permission to create, update, or delete roles in a namespace implies the ability to create a Policy object itself.

func (*VirtualRegistry) GetRole added in v0.4.2

func (m *VirtualRegistry) GetRole(ctx kapi.Context, name string) (*authorizationapi.Role, error)

func (*VirtualRegistry) ListRoles added in v0.4.2

TODO either add selector for fields ot eliminate the option

func (*VirtualRegistry) UpdateRole added in v0.4.2

func (m *VirtualRegistry) UpdateRole(ctx kapi.Context, role *authorizationapi.Role) error

Jump to

Keyboard shortcuts

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