Documentation ¶
Index ¶
- func HasPermissions(ctx context.Context, scope Scope, perms ...Permission) error
- type Permission
- type Role
- type Scope
- type Service
- func (s *Service) ChangePassword(ctx context.Context, username, oldPass, newPass string) error
- func (s *Service) CloneRole(ctx context.Context, srcName, dstName string) error
- func (s *Service) CreateRole(ctx context.Context, role Role) error
- func (s *Service) CreateUser(ctx context.Context, user User) error
- func (s *Service) DeleteRole(ctx context.Context, name string) error
- func (s *Service) DeleteUser(ctx context.Context, username string) error
- func (s *Service) GetPermissions(ctx context.Context, username string) map[string][]string
- func (s *Service) GetRole(ctx context.Context, name string) (Role, error)
- func (s *Service) GetUser(ctx context.Context, username string) (User, error)
- func (s *Service) ListRoles(ctx context.Context) ([]Role, error)
- func (s *Service) ListUsers(ctx context.Context) ([]User, error)
- func (s *Service) UpdateRole(ctx context.Context, role Role) error
- func (s *Service) UpdateUser(ctx context.Context, user User) error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPermissions ¶
func HasPermissions(ctx context.Context, scope Scope, perms ...Permission) error
Types ¶
type Permission ¶
type Permission uint8
const ( PermRead Permission = iota PermCreate PermUpdate PermDelete )
func (Permission) String ¶
func (p Permission) String() string
type Role ¶
type Scope ¶
type Scope string
const ( ScopeHosts Scope = "hosts" ScopeConfigOpt Scope = "config-opt" ScopePool Scope = "pool" ScopeOsd Scope = "osd" ScopeMonitor Scope = "monitor" ScopeRbdImage Scope = "rbd-image" ScopeIscsi Scope = "iscsi" ScopeRbdMirroring Scope = "rbd-mirroring" ScopeRgw Scope = "rgw" ScopeCephfs Scope = "cephfs" ScopeManager Scope = "manager" ScopeLog Scope = "log" ScopeGrafana Scope = "grafana" ScopePrometheus Scope = "prometheus" ScopeUser Scope = "user" ScopeDashboardSettings Scope = "dashboard-setting" ScopeNfsGanesha Scope = "nfs-ganesha" ScopeNvmeOf Scope = "nvme-of" )
type Service ¶
func (*Service) ChangePassword ¶
func (*Service) DeleteUser ¶
func (*Service) GetPermissions ¶
type User ¶
type User struct { Username string `json:"username"` Roles []string `json:"roles"` Password string `json:"password"` Name *string `json:"name"` Email *string `json:"email"` LastUpdate int `json:"lastUpdate"` Enabled bool `json:"enabled"` PwdExpirationDate *int `json:"pwdExpirationDate"` PwdUpdateRequired bool `json:"pwdUpdateRequired"` }
Click to show internal directories.
Click to hide internal directories.