MCPcopy
hub / github.com/ccfos/nightingale / CheckPerm

Method CheckPerm

models/user.go:849–855  ·  view source on GitHub ↗
(ctx *ctx.Context, operation string)

Source from the content-addressed store, hash-verified

847}
848
849func (u *User) CheckPerm(ctx *ctx.Context, operation string) (bool, error) {
850 if u.IsAdmin() {
851 return true, nil
852 }
853
854 return RoleHasOperation(ctx, u.RolesLst, operation)
855}
856
857func UserStatistics(ctx *ctx.Context) (*Statistics, error) {
858 if !ctx.IsCenter {

Callers 2

permMethod · 0.80
targetBindBgidsMethod · 0.80

Calls 2

IsAdminMethod · 0.95
RoleHasOperationFunction · 0.85

Tested by

no test coverage detected