Documentation ¶
Index ¶
- func CheckPermission(s string) error
- func CheckResource(s string) error
- func CheckSubject(s string) error
- func CheckTerm(s string) error
- func GetPermissionUID(ps []Permission, p string) string
- func GetSubjectUID(ss []Subject, sub string) string
- type ACCheckPermissions
- type ACCheckPermissionsInput
- type ACPermissionPayload
- type ErrorResponseType
- type Extensions
- type Member
- type OU
- type Object
- type ObjectAddPermissionsInput
- type Organization
- type OrganizationAddOUInput
- type OrganizationBatchAddMemberInput
- type OrganizationBatchAddOUMemberInput
- type OrganizationInput
- type OrganizationListInput
- type OrganizationListOUMembersInput
- type OrganizationListOUsInput
- type OrganizationListSubjectOUsInput
- type OrganizationListSubjectOrgsInput
- type OrganizationOUInput
- type OrganizationSearchInput
- type OrganizationStatusInput
- type OrganizationUpdateMemberStatusInput
- type OrganizationUpdateOUParentInput
- type Pagination
- type Permission
- type PermissionBatchAddInput
- type PermissionDeleteInput
- type PermissionEx
- type PermissionListInput
- type ResourcesInput
- type ResponseType
- type Scope
- type ScopeListInput
- type ScopeListUnitObjectsInput
- type ScopeUpdateInput
- type Subject
- type SubjectUpdateInput
- type SubjectsInput
- type SuccessResponseType
- type Target
- type TargetBatchAddInput
- type Tenant
- type TenantAddInput
- type Unit
- type UnitAddFromMembersInput
- type UnitAddFromOUInput
- type UnitAddFromOrgInput
- type UnitAddInput
- type UnitAddPermissionsInput
- type UnitAddSubjectsInput
- type UnitAssignObjectInput
- type UnitAssignParentInput
- type UnitAssignScopeInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPermissionUID ¶
func GetPermissionUID(ps []Permission, p string) string
GetPermissionUID ...
Types ¶
type ACCheckPermissions ¶
type ACCheckPermissions struct { PermissionBatchAddInput Subject string `json:"subject"` WithOrganization bool `json:"withOrganization"` IgnoreScope bool `json:"ignoreScope"` // 仅对 Object 权限检查有效 }
ACCheckPermissions ...
func (*ACCheckPermissions) Validate ¶
func (t *ACCheckPermissions) Validate() error
Validate 实现 gear.BodyTemplate
type ACCheckPermissionsInput ¶
type ACCheckPermissionsInput struct { Target ACCheckPermissions }
ACCheckPermissionsInput ...
func (*ACCheckPermissionsInput) Validate ¶
func (t *ACCheckPermissionsInput) Validate() error
Validate 实现 gear.BodyTemplate
type ACPermissionPayload ¶
type ACPermissionPayload struct { Target PermissionEx }
ACPermissionPayload ...
type ErrorResponseType ¶
type ErrorResponseType = gear.ErrorResponse
ErrorResponseType 定义了标准的 API 接口错误时返回数据模型
type Member ¶
type Member struct { UID string `json:"uid,omitempty"` Subject string `json:"subject"` Status int `json:"status"` }
Member ...
type OU ¶
type OU struct { UID string `json:"uid,omitempty"` OU string `json:"ou"` Parent string `json:"parent,omitempty"` Status int `json:"status"` }
OU ...
type Object ¶
type Object struct { UID string `json:"uid,omitempty"` TargetID string `json:"targetId"` TargetType string `json:"targetType"` Terms string `json:"terms,omitempty"` }
Object ...
type ObjectAddPermissionsInput ¶
ObjectAddPermissionsInput ...
func (*ObjectAddPermissionsInput) Validate ¶
func (t *ObjectAddPermissionsInput) Validate() error
Validate 实现 gear.BodyTemplate
type Organization ¶
type Organization struct { UID string `json:"uid,omitempty"` Org string `json:"organization"` Status int `json:"status"` }
Organization ...
type OrganizationAddOUInput ¶
type OrganizationAddOUInput struct { OrganizationInput OU string `json:"ou"` Parent string `json:"parent"` Terms string `json:"terms"` }
OrganizationAddOUInput ...
func (*OrganizationAddOUInput) Validate ¶
func (t *OrganizationAddOUInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationBatchAddMemberInput ¶
type OrganizationBatchAddMemberInput struct { OrganizationInput Subjects []struct { Subject Terms string `json:"terms"` } `json:"subjects"` }
OrganizationBatchAddMemberInput ...
func (*OrganizationBatchAddMemberInput) Validate ¶
func (t *OrganizationBatchAddMemberInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationBatchAddOUMemberInput ¶
type OrganizationBatchAddOUMemberInput struct { OrganizationOUInput SubjectsInput }
OrganizationBatchAddOUMemberInput ...
func (*OrganizationBatchAddOUMemberInput) Validate ¶
func (t *OrganizationBatchAddOUMemberInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationInput ¶
type OrganizationInput struct {
Org string `json:"organization"`
}
OrganizationInput ...
func (*OrganizationInput) Validate ¶
func (t *OrganizationInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationListInput ¶
type OrganizationListInput struct { OrganizationInput Pagination }
OrganizationListInput ...
func (*OrganizationListInput) Validate ¶
func (t *OrganizationListInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationListOUMembersInput ¶
type OrganizationListOUMembersInput struct { OrganizationInput Pagination OU string `json:"ou"` }
OrganizationListOUMembersInput ...
func (*OrganizationListOUMembersInput) Validate ¶
func (t *OrganizationListOUMembersInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationListOUsInput ¶
type OrganizationListOUsInput struct { OrganizationInput Pagination Parent string `json:"parent"` }
OrganizationListOUsInput ...
func (*OrganizationListOUsInput) Validate ¶
func (t *OrganizationListOUsInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationListSubjectOUsInput ¶
type OrganizationListSubjectOUsInput struct { OrganizationListSubjectOrgsInput OrganizationInput }
OrganizationListSubjectOUsInput ...
func (*OrganizationListSubjectOUsInput) Validate ¶
func (t *OrganizationListSubjectOUsInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationListSubjectOrgsInput ¶
type OrganizationListSubjectOrgsInput struct { Pagination Subject string `json:"subject"` }
OrganizationListSubjectOrgsInput ...
func (*OrganizationListSubjectOrgsInput) Validate ¶
func (t *OrganizationListSubjectOrgsInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationOUInput ¶
type OrganizationOUInput struct { OrganizationInput OU string `json:"ou"` }
OrganizationOUInput ...
func (*OrganizationOUInput) Validate ¶
func (t *OrganizationOUInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationSearchInput ¶
type OrganizationSearchInput struct { OrganizationInput Pagination Term string `json:"term"` }
OrganizationSearchInput ...
func (*OrganizationSearchInput) Validate ¶
func (t *OrganizationSearchInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationStatusInput ¶
type OrganizationStatusInput struct { OrganizationInput Status int `json:"status"` }
OrganizationStatusInput ...
func (*OrganizationStatusInput) Validate ¶
func (t *OrganizationStatusInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationUpdateMemberStatusInput ¶
type OrganizationUpdateMemberStatusInput struct { OrganizationStatusInput Subject string `json:"subject"` }
OrganizationUpdateMemberStatusInput ...
func (*OrganizationUpdateMemberStatusInput) Validate ¶
func (t *OrganizationUpdateMemberStatusInput) Validate() error
Validate 实现 gear.BodyTemplate
type OrganizationUpdateOUParentInput ¶
type OrganizationUpdateOUParentInput struct { OrganizationInput OU string `json:"ou"` Parent string `json:"parent"` }
OrganizationUpdateOUParentInput ...
func (*OrganizationUpdateOUParentInput) Validate ¶
func (t *OrganizationUpdateOUParentInput) Validate() error
Validate 实现 gear.BodyTemplate
type Pagination ¶
type Pagination struct { PageToken string `json:"pageToken" query:"pageToken"` PageSize int `json:"pageSize" query:"pageSize"` Skip int `json:"skip" query:"skip"` }
Pagination ...
type Permission ¶
Permission ...
type PermissionBatchAddInput ¶
type PermissionBatchAddInput struct {
Permissions []string `json:"permissions"`
}
PermissionBatchAddInput ...
func (*PermissionBatchAddInput) Validate ¶
func (t *PermissionBatchAddInput) Validate() error
Validate 实现 gear.BodyTemplate
type PermissionDeleteInput ¶
type PermissionDeleteInput struct {
Permission string `json:"permission"`
}
PermissionDeleteInput ...
func (*PermissionDeleteInput) Validate ¶
func (t *PermissionDeleteInput) Validate() error
Validate 实现 gear.BodyTemplate
type PermissionEx ¶
type PermissionEx struct { Permission string `json:"permission"` Extensions Extensions `json:"extensions"` }
PermissionEx ...
func (*PermissionEx) Validate ¶
func (t *PermissionEx) Validate() error
Validate 实现 gear.BodyTemplate
type PermissionListInput ¶
type PermissionListInput struct { Pagination ResourcesInput }
PermissionListInput ...
func (*PermissionListInput) Validate ¶
func (t *PermissionListInput) Validate() error
Validate 实现 gear.BodyTemplate
type ResourcesInput ¶
type ResourcesInput struct {
Resources []string `json:"resources"`
}
ResourcesInput ...
func (*ResourcesInput) Validate ¶
func (t *ResourcesInput) Validate() error
Validate 实现 gear.BodyTemplate
type ResponseType ¶
type ResponseType struct { ErrorResponseType SuccessResponseType }
ResponseType ...
type Scope ¶
type Scope struct { UID string `json:"uid,omitempty"` Status int `json:"status"` TargetID string `json:"targetId"` TargetType string `json:"targetType"` }
Scope ...
type ScopeListInput ¶
type ScopeListInput struct { Pagination TargetType string `json:"targetType"` }
ScopeListInput ...
func (*ScopeListInput) Validate ¶
func (t *ScopeListInput) Validate() error
Validate 实现 gear.BodyTemplate
type ScopeListUnitObjectsInput ¶
type ScopeListUnitObjectsInput struct { Pagination Scope Target `json:"scope"` TargetType string `json:"targetType"` }
ScopeListUnitObjectsInput ...
func (*ScopeListUnitObjectsInput) Validate ¶
func (t *ScopeListUnitObjectsInput) Validate() error
Validate 实现 gear.BodyTemplate
type ScopeUpdateInput ¶
ScopeUpdateInput ...
func (*ScopeUpdateInput) Validate ¶
func (t *ScopeUpdateInput) Validate() error
Validate 实现 gear.BodyTemplate
type Subject ¶
type Subject struct { UID string `json:"uid,omitempty"` Status int `json:"status"` Sub string `json:"subject"` }
Subject ...
type SubjectUpdateInput ¶
SubjectUpdateInput ...
func (*SubjectUpdateInput) Validate ¶
func (t *SubjectUpdateInput) Validate() error
Validate 实现 gear.BodyTemplate
type SubjectsInput ¶
type SubjectsInput struct {
Subjects []string `json:"subjects"`
}
SubjectsInput ...
func (*SubjectsInput) Validate ¶
func (t *SubjectsInput) Validate() error
Validate 实现 gear.BodyTemplate
type SuccessResponseType ¶
type SuccessResponseType struct { TotalCount int `json:"totalCount,omitempty"` NextToken string `json:"nextToken,omitempty"` Result interface{} `json:"result"` }
SuccessResponseType 定义了标准的 API 接口成功时返回数据模型
type TargetBatchAddInput ¶
type TargetBatchAddInput struct { Targets []Target `json:"targets"` Parent *Target `json:"parent"` Scope *Target `json:"scope"` }
TargetBatchAddInput ...
func (*TargetBatchAddInput) Validate ¶
func (t *TargetBatchAddInput) Validate() error
Validate 实现 gear.BodyTemplate
type Tenant ¶
type Tenant struct { UID string `json:"uid,omitempty"` Tenant string `json:"tenant"` Status int `json:"status"` }
Tenant ...
type TenantAddInput ¶
TenantAddInput ...
func (*TenantAddInput) Validate ¶
func (t *TenantAddInput) Validate() error
Validate 实现 gear.BodyTemplate
type Unit ¶
type Unit struct { UID string `json:"uid,omitempty"` Status int `json:"status"` TargetID string `json:"targetId"` TargetType string `json:"targetType"` }
Unit ...
type UnitAddFromMembersInput ¶
type UnitAddFromMembersInput struct { UnitAddInput OrganizationInput SubjectsInput }
UnitAddFromMembersInput ...
func (*UnitAddFromMembersInput) Validate ¶
func (t *UnitAddFromMembersInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAddFromOUInput ¶
type UnitAddFromOUInput struct { UnitAddInput OrganizationOUInput }
UnitAddFromOUInput ...
func (*UnitAddFromOUInput) Validate ¶
func (t *UnitAddFromOUInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAddFromOrgInput ¶
type UnitAddFromOrgInput struct { UnitAddInput OrganizationInput }
UnitAddFromOrgInput ...
func (*UnitAddFromOrgInput) Validate ¶
func (t *UnitAddFromOrgInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAddInput ¶
UnitAddInput ...
func (*UnitAddInput) Validate ¶
func (t *UnitAddInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAddPermissionsInput ¶
type UnitAddPermissionsInput struct { Target Permissions []PermissionEx `json:"permissions"` }
UnitAddPermissionsInput ...
func (*UnitAddPermissionsInput) Validate ¶
func (t *UnitAddPermissionsInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAddSubjectsInput ¶
type UnitAddSubjectsInput struct { Target SubjectsInput }
UnitAddSubjectsInput ...
func (*UnitAddSubjectsInput) Validate ¶
func (t *UnitAddSubjectsInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAssignObjectInput ¶
UnitAssignObjectInput ...
func (*UnitAssignObjectInput) Validate ¶
func (t *UnitAssignObjectInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAssignParentInput ¶
UnitAssignParentInput ...
func (*UnitAssignParentInput) Validate ¶
func (t *UnitAssignParentInput) Validate() error
Validate 实现 gear.BodyTemplate
type UnitAssignScopeInput ¶
UnitAssignScopeInput ...
func (*UnitAssignScopeInput) Validate ¶
func (t *UnitAssignScopeInput) Validate() error
Validate 实现 gear.BodyTemplate