permission

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Role_name = map[int32]string{
		0:  "READER",
		10: "WRITER",
		20: "OWNER",
	}
	Role_value = map[string]int32{
		"READER": 0,
		"WRITER": 10,
		"OWNER":  20,
	}
)

Enum value maps for Role.

View Source
var (
	ElementType_name = map[int32]string{
		0: "USER",
		1: "GROUP",
	}
	ElementType_value = map[string]int32{
		"USER":  0,
		"GROUP": 1,
	}
)

Enum value maps for ElementType.

View Source
var File_gsloc_api_config_permission_v1_permission_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Element

type Element struct {
	ElementType ElementType `` /* 143-byte string literal not displayed */
	ElementName string      `protobuf:"bytes,2,opt,name=element_name,json=elementName,proto3" json:"element_name,omitempty"`
	// contains filtered or unexported fields
}

Member is a user or a group.

func (*Element) Descriptor deprecated

func (*Element) Descriptor() ([]byte, []int)

Deprecated: Use Element.ProtoReflect.Descriptor instead.

func (*Element) GetElementName

func (x *Element) GetElementName() string

func (*Element) GetElementType

func (x *Element) GetElementType() ElementType

func (*Element) ProtoMessage

func (*Element) ProtoMessage()

func (*Element) ProtoReflect

func (x *Element) ProtoReflect() protoreflect.Message

func (*Element) Reset

func (x *Element) Reset()

func (*Element) String

func (x *Element) String() string

func (*Element) Validate

func (m *Element) Validate() error

Validate checks the field values on Element with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Element) ValidateAll

func (m *Element) ValidateAll() error

ValidateAll checks the field values on Element with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ElementMultiError, or nil if none found.

type ElementMultiError

type ElementMultiError []error

ElementMultiError is an error wrapping multiple validation errors returned by Element.ValidateAll() if the designated constraints aren't met.

func (ElementMultiError) AllErrors

func (m ElementMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ElementMultiError) Error

func (m ElementMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ElementPermission

type ElementPermission struct {
	Role    Role     `protobuf:"varint,1,opt,name=role,proto3,enum=gsloc.api.config.permission.v1.Role" json:"role,omitempty"`
	Element *Element `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"`
	// contains filtered or unexported fields
}

MemberPermission is a permission on a resource for a given member.

func (*ElementPermission) Descriptor deprecated

func (*ElementPermission) Descriptor() ([]byte, []int)

Deprecated: Use ElementPermission.ProtoReflect.Descriptor instead.

func (*ElementPermission) GetElement

func (x *ElementPermission) GetElement() *Element

func (*ElementPermission) GetRole

func (x *ElementPermission) GetRole() Role

func (*ElementPermission) ProtoMessage

func (*ElementPermission) ProtoMessage()

func (*ElementPermission) ProtoReflect

func (x *ElementPermission) ProtoReflect() protoreflect.Message

func (*ElementPermission) Reset

func (x *ElementPermission) Reset()

func (*ElementPermission) String

func (x *ElementPermission) String() string

func (*ElementPermission) Validate

func (m *ElementPermission) Validate() error

Validate checks the field values on ElementPermission with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ElementPermission) ValidateAll

func (m *ElementPermission) ValidateAll() error

ValidateAll checks the field values on ElementPermission with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ElementPermissionMultiError, or nil if none found.

type ElementPermissionMultiError

type ElementPermissionMultiError []error

ElementPermissionMultiError is an error wrapping multiple validation errors returned by ElementPermission.ValidateAll() if the designated constraints aren't met.

func (ElementPermissionMultiError) AllErrors

func (m ElementPermissionMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ElementPermissionMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ElementPermissionValidationError

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

ElementPermissionValidationError is the validation error returned by ElementPermission.Validate if the designated constraints aren't met.

func (ElementPermissionValidationError) Cause

Cause function returns cause value.

func (ElementPermissionValidationError) Error

Error satisfies the builtin error interface

func (ElementPermissionValidationError) ErrorName

ErrorName returns error name.

func (ElementPermissionValidationError) Field

Field function returns field value.

func (ElementPermissionValidationError) Key

Key function returns key value.

func (ElementPermissionValidationError) Reason

Reason function returns reason value.

type ElementType

type ElementType int32

MemberType is the type of the member.

const (
	ElementType_USER  ElementType = 0
	ElementType_GROUP ElementType = 1
)

func (ElementType) Descriptor

func (ElementType) Enum

func (x ElementType) Enum() *ElementType

func (ElementType) EnumDescriptor deprecated

func (ElementType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ElementType.Descriptor instead.

func (ElementType) Number

func (x ElementType) Number() protoreflect.EnumNumber

func (ElementType) String

func (x ElementType) String() string

func (ElementType) Type

type ElementValidationError

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

ElementValidationError is the validation error returned by Element.Validate if the designated constraints aren't met.

func (ElementValidationError) Cause

func (e ElementValidationError) Cause() error

Cause function returns cause value.

func (ElementValidationError) Error

func (e ElementValidationError) Error() string

Error satisfies the builtin error interface

func (ElementValidationError) ErrorName

func (e ElementValidationError) ErrorName() string

ErrorName returns error name.

func (ElementValidationError) Field

func (e ElementValidationError) Field() string

Field function returns field value.

func (ElementValidationError) Key

func (e ElementValidationError) Key() bool

Key function returns key value.

func (ElementValidationError) Reason

func (e ElementValidationError) Reason() string

Reason function returns reason value.

type Role

type Role int32

Role is the permission role. READER: can read the entry. WRITER: can read and update the entry. OWNER: can read, update, delete and set permission on the entry. Order is important, it is used to check if a user has a permission or higher.

const (
	Role_READER Role = 0
	Role_WRITER Role = 10
	Role_OWNER  Role = 20
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated

func (Role) EnumDescriptor() ([]byte, []int)

Deprecated: Use Role.Descriptor instead.

func (Role) Number

func (x Role) Number() protoreflect.EnumNumber

func (Role) String

func (x Role) String() string

func (Role) Type

func (Role) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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