Documentation
¶
Index ¶
- Variables
- func Delete(_ context.Context, db gorpmapper.SqlExecutorWithTx, rb sdk.RBAC) error
- func FillWithIDs(ctx context.Context, db gorp.SqlExecutor, r *sdk.RBAC) error
- func HasGlobalRole(ctx context.Context, db gorp.SqlExecutor, role string, userID string) (bool, error)
- func HasRoleOnProjectAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string, ...) (bool, error)
- func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, rb *sdk.RBAC) error
- func IsCurrentUser(_ context.Context, auth *sdk.AuthConsumer, _ cache.Store, _ gorp.SqlExecutor, ...) error
- func IsHookService(_ context.Context, auth *sdk.AuthConsumer, _ cache.Store, _ gorp.SqlExecutor, ...) error
- func LoadProjectKeysByRoleAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string) ([]string, error)
- func LoadRBACByName(ctx context.Context, db gorp.SqlExecutor, name string, opts ...LoadOptionFunc) (*sdk.RBAC, error)
- func OrganizationManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, ...) error
- func PermissionManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, ...) error
- func ProjectManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, ...) error
- func ProjectRead(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, ...) error
- func RegionManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, ...) error
- func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, rb *sdk.RBAC) error
- type LoadOptionFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var LoadOptions = struct { Default LoadOptionFunc LoadRBACGlobal LoadOptionFunc LoadRBACProject LoadOptionFunc }{ Default: loadDefault, LoadRBACGlobal: loadRBACGlobal, LoadRBACProject: loadRBACProject, }
LoadOptions provides all options on rbac loads functions
View Source
var (
LogFieldRole = log.Field("action_metadata_role")
)
Functions ¶
func Delete ¶
func Delete(_ context.Context, db gorpmapper.SqlExecutorWithTx, rb sdk.RBAC) error
func FillWithIDs ¶
func HasGlobalRole ¶
func Insert ¶
func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, rb *sdk.RBAC) error
Insert a RBAC permission in database
func IsCurrentUser ¶
func IsHookService ¶
func LoadRBACByName ¶
func LoadRBACByName(ctx context.Context, db gorp.SqlExecutor, name string, opts ...LoadOptionFunc) (*sdk.RBAC, error)
func OrganizationManage ¶
func PermissionManage ¶
func PermissionManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, db gorp.SqlExecutor, _ map[string]string) error
PermissionManage return nil if the current AuthConsumer have the ProjectRoleManage on current project KEY
func ProjectManage ¶
func ProjectManage(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, db gorp.SqlExecutor, vars map[string]string) error
ProjectManage return nil if the current AuthConsumer have the ProjectRoleManage on current project KEY
func ProjectRead ¶
func ProjectRead(ctx context.Context, auth *sdk.AuthConsumer, store cache.Store, db gorp.SqlExecutor, vars map[string]string) error
ProjectRead return nil if the current AuthConsumer have the ProjectRoleRead on current project KEY
func RegionManage ¶
func Update ¶
func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, rb *sdk.RBAC) error
Types ¶
type LoadOptionFunc ¶
type LoadOptionFunc func(context.Context, gorp.SqlExecutor, *rbac) error
LoadOptionFunc is used as options to loadProject functions
Click to show internal directories.
Click to hide internal directories.