permissionv1

package
v1.36.10-2024090223254... Latest Latest
Warning

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

Go to latest
Published: unknown License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Role_name = map[int32]string{
		0: "ROLE_UNSPECIFIED",
		1: "ROLE_GUEST",
		2: "ROLE_USER",
		3: "ROLE_CONTENT_MANAGER",
		4: "ROLE_ADMIN",
		5: "ROLE_ROOT",
	}
	Role_value = map[string]int32{
		"ROLE_UNSPECIFIED":     0,
		"ROLE_GUEST":           1,
		"ROLE_USER":            2,
		"ROLE_CONTENT_MANAGER": 3,
		"ROLE_ADMIN":           4,
		"ROLE_ROOT":            5,
	}
)

Enum value maps for Role.

View Source
var (
	ResourceType_name = map[int32]string{
		0: "RESOURCE_TYPE_UNSPECIFIED",
		1: "RESOURCE_TYPE_GLOBAL",
		2: "RESOURCE_TYPE_LIBRARY",
		3: "RESOURCE_TYPE_BOOK",
	}
	ResourceType_value = map[string]int32{
		"RESOURCE_TYPE_UNSPECIFIED": 0,
		"RESOURCE_TYPE_GLOBAL":      1,
		"RESOURCE_TYPE_LIBRARY":     2,
		"RESOURCE_TYPE_BOOK":        3,
	}
)

Enum value maps for ResourceType.

View Source
var File_listenup_permission_v1_permission_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Permissions

type Permissions struct {
	CanRead              bool `protobuf:"varint,1,opt,name=can_read,json=canRead,proto3" json:"can_read,omitempty"`
	CanUpdate            bool `protobuf:"varint,2,opt,name=can_update,json=canUpdate,proto3" json:"can_update,omitempty"`
	CanAdd               bool `protobuf:"varint,3,opt,name=can_add,json=canAdd,proto3" json:"can_add,omitempty"`
	CanDelete            bool `protobuf:"varint,4,opt,name=can_delete,json=canDelete,proto3" json:"can_delete,omitempty"`
	CanManageUsers       bool `protobuf:"varint,5,opt,name=can_manage_users,json=canManageUsers,proto3" json:"can_manage_users,omitempty"`
	CanManagePermissions bool `protobuf:"varint,6,opt,name=can_manage_permissions,json=canManagePermissions,proto3" json:"can_manage_permissions,omitempty"`
	// contains filtered or unexported fields
}

Represents a set of permissions

func (*Permissions) GetCanAdd

func (x *Permissions) GetCanAdd() bool

func (*Permissions) GetCanDelete

func (x *Permissions) GetCanDelete() bool

func (*Permissions) GetCanManagePermissions

func (x *Permissions) GetCanManagePermissions() bool

func (*Permissions) GetCanManageUsers

func (x *Permissions) GetCanManageUsers() bool

func (*Permissions) GetCanRead

func (x *Permissions) GetCanRead() bool

func (*Permissions) GetCanUpdate

func (x *Permissions) GetCanUpdate() bool

func (*Permissions) ProtoMessage

func (*Permissions) ProtoMessage()

func (*Permissions) ProtoReflect

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

func (*Permissions) Reset

func (x *Permissions) Reset()

func (*Permissions) SetCanAdd

func (x *Permissions) SetCanAdd(v bool)

func (*Permissions) SetCanDelete

func (x *Permissions) SetCanDelete(v bool)

func (*Permissions) SetCanManagePermissions

func (x *Permissions) SetCanManagePermissions(v bool)

func (*Permissions) SetCanManageUsers

func (x *Permissions) SetCanManageUsers(v bool)

func (*Permissions) SetCanRead

func (x *Permissions) SetCanRead(v bool)

func (*Permissions) SetCanUpdate

func (x *Permissions) SetCanUpdate(v bool)

func (*Permissions) String

func (x *Permissions) String() string

type Permissions_builder

type Permissions_builder struct {
	CanRead              bool
	CanUpdate            bool
	CanAdd               bool
	CanDelete            bool
	CanManageUsers       bool
	CanManagePermissions bool
	// contains filtered or unexported fields
}

func (Permissions_builder) Build

func (b0 Permissions_builder) Build() *Permissions

type ResourcePermissions

type ResourcePermissions struct {

	// The type of the resource (so we know what to look up)
	ResourceType ResourceType `` /* 139-byte string literal not displayed */
	// The id of the resource itself
	ResourceId string `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	// contains filtered or unexported fields
}

Represents permissions for a specific resource

func (*ResourcePermissions) GetResourceId

func (x *ResourcePermissions) GetResourceId() string

func (*ResourcePermissions) GetResourceType

func (x *ResourcePermissions) GetResourceType() ResourceType

func (*ResourcePermissions) ProtoMessage

func (*ResourcePermissions) ProtoMessage()

func (*ResourcePermissions) ProtoReflect

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

func (*ResourcePermissions) Reset

func (x *ResourcePermissions) Reset()

func (*ResourcePermissions) SetResourceId

func (x *ResourcePermissions) SetResourceId(v string)

func (*ResourcePermissions) SetResourceType

func (x *ResourcePermissions) SetResourceType(v ResourceType)

func (*ResourcePermissions) String

func (x *ResourcePermissions) String() string

type ResourcePermissions_builder

type ResourcePermissions_builder struct {

	// The type of the resource (so we know what to look up)
	ResourceType ResourceType
	// The id of the resource itself
	ResourceId string
	// contains filtered or unexported fields
}

func (ResourcePermissions_builder) Build

type ResourceType

type ResourceType int32

Enum representing the types of resources

const (
	ResourceType_RESOURCE_TYPE_UNSPECIFIED ResourceType = 0
	ResourceType_RESOURCE_TYPE_GLOBAL      ResourceType = 1
	ResourceType_RESOURCE_TYPE_LIBRARY     ResourceType = 2
	ResourceType_RESOURCE_TYPE_BOOK        ResourceType = 3
)

func (ResourceType) Descriptor

func (ResourceType) Enum

func (x ResourceType) Enum() *ResourceType

func (ResourceType) Number

func (ResourceType) String

func (x ResourceType) String() string

func (ResourceType) Type

type Role

type Role int32

Enum representing the available roles in the system

const (
	Role_ROLE_UNSPECIFIED     Role = 0
	Role_ROLE_GUEST           Role = 1
	Role_ROLE_USER            Role = 2
	Role_ROLE_CONTENT_MANAGER Role = 3
	Role_ROLE_ADMIN           Role = 4
	Role_ROLE_ROOT            Role = 5
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

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

type RolePermissions

type RolePermissions struct {

	// The role the permission is attached to
	Role Role `protobuf:"varint,1,opt,name=role,proto3,enum=listenup.permission.v1.Role" json:"role,omitempty"`
	// The individual permissions themselves
	Permissions *Permissions `protobuf:"bytes,2,opt,name=permissions,proto3" json:"permissions,omitempty"`
	// contains filtered or unexported fields
}

Defines the default permissions for each role

func (*RolePermissions) ClearPermissions

func (x *RolePermissions) ClearPermissions()

func (*RolePermissions) GetPermissions

func (x *RolePermissions) GetPermissions() *Permissions

func (*RolePermissions) GetRole

func (x *RolePermissions) GetRole() Role

func (*RolePermissions) HasPermissions

func (x *RolePermissions) HasPermissions() bool

func (*RolePermissions) ProtoMessage

func (*RolePermissions) ProtoMessage()

func (*RolePermissions) ProtoReflect

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

func (*RolePermissions) Reset

func (x *RolePermissions) Reset()

func (*RolePermissions) SetPermissions

func (x *RolePermissions) SetPermissions(v *Permissions)

func (*RolePermissions) SetRole

func (x *RolePermissions) SetRole(v Role)

func (*RolePermissions) String

func (x *RolePermissions) String() string

type RolePermissions_builder

type RolePermissions_builder struct {

	// The role the permission is attached to
	Role Role
	// The individual permissions themselves
	Permissions *Permissions
	// contains filtered or unexported fields
}

func (RolePermissions_builder) Build

Source Files

  • permission.pb.go

Jump to

Keyboard shortcuts

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