Documentation
¶
Index ¶
- Variables
- type Permissions
- func (x *Permissions) GetCanAdd() bool
- func (x *Permissions) GetCanDelete() bool
- func (x *Permissions) GetCanManagePermissions() bool
- func (x *Permissions) GetCanManageUsers() bool
- func (x *Permissions) GetCanRead() bool
- func (x *Permissions) GetCanUpdate() bool
- func (*Permissions) ProtoMessage()
- func (x *Permissions) ProtoReflect() protoreflect.Message
- func (x *Permissions) Reset()
- func (x *Permissions) SetCanAdd(v bool)
- func (x *Permissions) SetCanDelete(v bool)
- func (x *Permissions) SetCanManagePermissions(v bool)
- func (x *Permissions) SetCanManageUsers(v bool)
- func (x *Permissions) SetCanRead(v bool)
- func (x *Permissions) SetCanUpdate(v bool)
- func (x *Permissions) String() string
- type Permissions_builder
- type ResourcePermissions
- func (x *ResourcePermissions) GetResourceId() string
- func (x *ResourcePermissions) GetResourceType() ResourceType
- func (*ResourcePermissions) ProtoMessage()
- func (x *ResourcePermissions) ProtoReflect() protoreflect.Message
- func (x *ResourcePermissions) Reset()
- func (x *ResourcePermissions) SetResourceId(v string)
- func (x *ResourcePermissions) SetResourceType(v ResourceType)
- func (x *ResourcePermissions) String() string
- type ResourcePermissions_builder
- type ResourceType
- type Role
- type RolePermissions
- func (x *RolePermissions) ClearPermissions()
- func (x *RolePermissions) GetPermissions() *Permissions
- func (x *RolePermissions) GetRole() Role
- func (x *RolePermissions) HasPermissions() bool
- func (*RolePermissions) ProtoMessage()
- func (x *RolePermissions) ProtoReflect() protoreflect.Message
- func (x *RolePermissions) Reset()
- func (x *RolePermissions) SetPermissions(v *Permissions)
- func (x *RolePermissions) SetRole(v Role)
- func (x *RolePermissions) String() string
- type RolePermissions_builder
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 ¶
func (b0 ResourcePermissions_builder) Build() *ResourcePermissions
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) Descriptor() protoreflect.EnumDescriptor
func (ResourceType) Enum ¶
func (x ResourceType) Enum() *ResourceType
func (ResourceType) Number ¶
func (x ResourceType) Number() protoreflect.EnumNumber
func (ResourceType) String ¶
func (x ResourceType) String() string
func (ResourceType) Type ¶
func (ResourceType) Type() protoreflect.EnumType
type Role ¶
type Role int32
Enum representing the available roles in the system
func (Role) Descriptor ¶
func (Role) Descriptor() protoreflect.EnumDescriptor
func (Role) Number ¶
func (x Role) Number() protoreflect.EnumNumber
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 ¶
func (b0 RolePermissions_builder) Build() *RolePermissions
Source Files
¶
- permission.pb.go
Click to show internal directories.
Click to hide internal directories.