permission

package
v0.0.0-...-b63aa1a Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	//
	//权限点id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" form:"id"`
	//
	//系统名
	System string `protobuf:"bytes,2,opt,name=system,proto3" json:"system" form:"system"`
	//
	//需要鉴权的动作, 全局唯一
	Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action" form:"action"`
	//
	//权限备注
	Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark" form:"remark"`
	//
	//权限角色
	Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles" form:"roles"`
	//
	//单个资源结构参考PermissionResource. 如果依赖多个资源,资源间判定逻辑条件用%and或者%or来扩住。 比如: { "%or":[ { "system":"flow", "condition":{ "executeAuthorizers":"%user" }, "name":"flow" }, { "system":"tool", "condition":{ "executeAuthorizers":"%user" }, "name":"tool" } ] } 表示这个权限点依赖流程的执行授权白名单和工具的执行授权白名单才能鉴权成功。
	Resource             *types.Value `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource" form:"resource"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

权限点

func (*Permission) Descriptor

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

func (*Permission) GetAction

func (m *Permission) GetAction() string

func (*Permission) GetId

func (m *Permission) GetId() string

func (*Permission) GetRemark

func (m *Permission) GetRemark() string

func (*Permission) GetResource

func (m *Permission) GetResource() *types.Value

func (*Permission) GetRoles

func (m *Permission) GetRoles() []string

func (*Permission) GetSystem

func (m *Permission) GetSystem() string

func (*Permission) ProtoMessage

func (*Permission) ProtoMessage()

func (*Permission) Reset

func (m *Permission) Reset()

func (*Permission) String

func (m *Permission) String() string

func (*Permission) Validate

func (this *Permission) Validate() error

func (*Permission) XXX_DiscardUnknown

func (m *Permission) XXX_DiscardUnknown()

func (*Permission) XXX_Marshal

func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Permission) XXX_Merge

func (m *Permission) XXX_Merge(src proto.Message)

func (*Permission) XXX_Size

func (m *Permission) XXX_Size() int

func (*Permission) XXX_Unmarshal

func (m *Permission) XXX_Unmarshal(b []byte) error

type PermissionResource

type PermissionResource struct {
	//
	//权限点id
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" form:"name"`
	//
	//系统名
	System string `protobuf:"bytes,2,opt,name=system,proto3" json:"system" form:"system"`
	//
	//验证条件
	Condition            *types.Struct `protobuf:"bytes,3,opt,name=condition,proto3" json:"condition" form:"condition"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

权限点的依赖资源(依赖资源需要先登记在permission的settings.permission_resource中)

func (*PermissionResource) Descriptor

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

func (*PermissionResource) GetCondition

func (m *PermissionResource) GetCondition() *types.Struct

func (*PermissionResource) GetName

func (m *PermissionResource) GetName() string

func (*PermissionResource) GetSystem

func (m *PermissionResource) GetSystem() string

func (*PermissionResource) ProtoMessage

func (*PermissionResource) ProtoMessage()

func (*PermissionResource) Reset

func (m *PermissionResource) Reset()

func (*PermissionResource) String

func (m *PermissionResource) String() string

func (*PermissionResource) Validate

func (this *PermissionResource) Validate() error

func (*PermissionResource) XXX_DiscardUnknown

func (m *PermissionResource) XXX_DiscardUnknown()

func (*PermissionResource) XXX_Marshal

func (m *PermissionResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PermissionResource) XXX_Merge

func (m *PermissionResource) XXX_Merge(src proto.Message)

func (*PermissionResource) XXX_Size

func (m *PermissionResource) XXX_Size() int

func (*PermissionResource) XXX_Unmarshal

func (m *PermissionResource) XXX_Unmarshal(b []byte) error

type Role

type Role struct {
	//
	//角色id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" form:"id"`
	//
	//角色所在org
	Org int32 `protobuf:"varint,2,opt,name=org,proto3" json:"org" form:"org"`
	//
	//角色名称
	Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role" form:"role"`
	//
	//角色下用户列表
	User []string `protobuf:"bytes,4,rep,name=user,proto3" json:"user" form:"user"`
	//
	//角色下权限id列表
	Permission []string `protobuf:"bytes,5,rep,name=permission,proto3" json:"permission" form:"permission"`
	//
	//角色下用户组列表
	UserGroup            []string `protobuf:"bytes,6,rep,name=user_group,json=userGroup,proto3" json:"user_group" form:"user_group"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

角色

func (*Role) Descriptor

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

func (*Role) GetId

func (m *Role) GetId() string

func (*Role) GetOrg

func (m *Role) GetOrg() int32

func (*Role) GetPermission

func (m *Role) GetPermission() []string

func (*Role) GetRole

func (m *Role) GetRole() string

func (*Role) GetUser

func (m *Role) GetUser() []string

func (*Role) GetUserGroup

func (m *Role) GetUserGroup() []string

func (*Role) ProtoMessage

func (*Role) ProtoMessage()

func (*Role) Reset

func (m *Role) Reset()

func (*Role) String

func (m *Role) String() string

func (*Role) Validate

func (this *Role) Validate() error

func (*Role) XXX_DiscardUnknown

func (m *Role) XXX_DiscardUnknown()

func (*Role) XXX_Marshal

func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Role) XXX_Merge

func (m *Role) XXX_Merge(src proto.Message)

func (*Role) XXX_Size

func (m *Role) XXX_Size() int

func (*Role) XXX_Unmarshal

func (m *Role) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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