Documentation ¶
Index ¶
- type AdminUserPermissionHandler
- type AppPermissionProcess
- type DefaultPermissionProcess
- type GetByUserAndScopePermissionProcess
- type InternalUserPermissionHandler
- type NormalUserPermissionHandler
- type PermissionAdaptor
- func (this *PermissionAdaptor) CheckPermission(req apistructs.PermissionCheckRequest) (bool, error)
- func (this *PermissionAdaptor) CheckPublicScope(userID string, scopeType apistructs.ScopeType, scopeID int64) (bool, error)
- func (this *PermissionAdaptor) GetCheckRequest(ctx context.Context) apistructs.PermissionCheckRequest
- func (this *PermissionAdaptor) GetScopeID(ctx context.Context) int64
- func (this *PermissionAdaptor) GetScopeType(ctx context.Context) apistructs.ScopeType
- func (this *PermissionAdaptor) GetUserID(ctx context.Context) string
- func (this *PermissionAdaptor) PermissionList(userID string, scopeType apistructs.ScopeType, scopeID int64) (apistructs.PermissionList, error)
- func (this *PermissionAdaptor) RegisterHandler(handler PermissionHandler)
- func (this *PermissionAdaptor) SetCheckRequest(ctx context.Context, req apistructs.PermissionCheckRequest) context.Context
- func (this *PermissionAdaptor) SetScopeID(ctx context.Context, ScopeID int64) context.Context
- func (this *PermissionAdaptor) SetScopeType(ctx context.Context, ScopeType apistructs.ScopeType) context.Context
- func (this *PermissionAdaptor) SetUserID(ctx context.Context, userID string) context.Context
- type PermissionHandler
- type PermissionProcess
- type PermissionProcessMiddleware
- type RolePermissionProcess
- type SupportUserPermissionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminUserPermissionHandler ¶
type AdminUserPermissionHandler struct {
Adaptor *PermissionAdaptor
}
func (AdminUserPermissionHandler) Access ¶
func (a AdminUserPermissionHandler) Access(ctx context.Context) bool
func (AdminUserPermissionHandler) CheckProcess ¶
func (a AdminUserPermissionHandler) CheckProcess(ctx context.Context) PermissionProcess
func (AdminUserPermissionHandler) PermissionListProcess ¶
func (a AdminUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess
type AppPermissionProcess ¶
type AppPermissionProcess struct {
Adaptor *PermissionAdaptor
}
func (AppPermissionProcess) GetAllRoles ¶
func (a AppPermissionProcess) GetAllRoles(ctx context.Context) ([]string, error)
type DefaultPermissionProcess ¶
type DefaultPermissionProcess struct { }
type GetByUserAndScopePermissionProcess ¶
type GetByUserAndScopePermissionProcess struct {
Adaptor *PermissionAdaptor
}
func (GetByUserAndScopePermissionProcess) GetAllRoles ¶
func (g GetByUserAndScopePermissionProcess) GetAllRoles(ctx context.Context) ([]string, error)
type InternalUserPermissionHandler ¶
type InternalUserPermissionHandler struct {
Adaptor *PermissionAdaptor
}
func (InternalUserPermissionHandler) Access ¶
func (a InternalUserPermissionHandler) Access(ctx context.Context) bool
func (InternalUserPermissionHandler) CheckProcess ¶
func (a InternalUserPermissionHandler) CheckProcess(ctx context.Context) PermissionProcess
func (InternalUserPermissionHandler) PermissionListProcess ¶
func (a InternalUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess
type NormalUserPermissionHandler ¶
type NormalUserPermissionHandler struct {
Adaptor *PermissionAdaptor
}
func (NormalUserPermissionHandler) Access ¶
func (n NormalUserPermissionHandler) Access(ctx context.Context) bool
func (NormalUserPermissionHandler) CheckProcess ¶
func (n NormalUserPermissionHandler) CheckProcess(ctx context.Context) PermissionProcess
func (NormalUserPermissionHandler) PermissionListProcess ¶
func (n NormalUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess
type PermissionAdaptor ¶
type PermissionAdaptor struct { Db *dao.DBClient Bdl *bundle.Bundle Handlers []PermissionHandler Once sync.Once }
func (*PermissionAdaptor) CheckPermission ¶
func (this *PermissionAdaptor) CheckPermission(req apistructs.PermissionCheckRequest) (bool, error)
func (*PermissionAdaptor) CheckPublicScope ¶
func (this *PermissionAdaptor) CheckPublicScope(userID string, scopeType apistructs.ScopeType, scopeID int64) (bool, error)
func (*PermissionAdaptor) GetCheckRequest ¶
func (this *PermissionAdaptor) GetCheckRequest(ctx context.Context) apistructs.PermissionCheckRequest
func (*PermissionAdaptor) GetScopeID ¶
func (this *PermissionAdaptor) GetScopeID(ctx context.Context) int64
func (*PermissionAdaptor) GetScopeType ¶
func (this *PermissionAdaptor) GetScopeType(ctx context.Context) apistructs.ScopeType
func (*PermissionAdaptor) GetUserID ¶
func (this *PermissionAdaptor) GetUserID(ctx context.Context) string
func (*PermissionAdaptor) PermissionList ¶
func (this *PermissionAdaptor) PermissionList(userID string, scopeType apistructs.ScopeType, scopeID int64) (apistructs.PermissionList, error)
func (*PermissionAdaptor) RegisterHandler ¶
func (this *PermissionAdaptor) RegisterHandler(handler PermissionHandler)
func (*PermissionAdaptor) SetCheckRequest ¶
func (this *PermissionAdaptor) SetCheckRequest(ctx context.Context, req apistructs.PermissionCheckRequest) context.Context
func (*PermissionAdaptor) SetScopeID ¶
func (*PermissionAdaptor) SetScopeType ¶
func (this *PermissionAdaptor) SetScopeType(ctx context.Context, ScopeType apistructs.ScopeType) context.Context
type PermissionHandler ¶
type PermissionHandler interface { Access(ctx context.Context) bool PermissionListProcess(ctx context.Context) PermissionProcess CheckProcess(ctx context.Context) PermissionProcess }
type PermissionProcess ¶
type PermissionProcess interface {
// contains filtered or unexported methods
}
type PermissionProcessMiddleware ¶
type PermissionProcessMiddleware struct { RealProcess PermissionProcess AfterProcess func(context.Context, *apistructs.PermissionList) (*apistructs.PermissionList, error) AfterCheck func(ctx context.Context, check bool) (bool, error) }
type RolePermissionProcess ¶
type RolePermissionProcess struct { Adaptor *PermissionAdaptor // contains filtered or unexported fields }
type SupportUserPermissionHandler ¶
type SupportUserPermissionHandler struct {
Adaptor *PermissionAdaptor
}
func (SupportUserPermissionHandler) Access ¶
func (s SupportUserPermissionHandler) Access(ctx context.Context) bool
func (SupportUserPermissionHandler) CheckProcess ¶
func (s SupportUserPermissionHandler) CheckProcess(ctx context.Context) PermissionProcess
func (SupportUserPermissionHandler) PermissionListProcess ¶
func (s SupportUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess
Click to show internal directories.
Click to hide internal directories.