Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUserExists = errors.New("user already exists")
)
This is a list of errors we support
Functions ¶
This section is empty.
Types ¶
type ClusterRole ¶
ClusterRole represents the roles of a cluster.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the high level user management engine.
func (*Engine) GetAllClusterRoles ¶
func (e *Engine) GetAllClusterRoles() []*ClusterRole
GetAllClusterRoles returns a list of all known cluster roles.
func (*Engine) GetAllUsers ¶
GetAllUsers returns a list of all registered users.
func (*Engine) UpsertUser ¶
func (e *Engine) UpsertUser(opts UpsertUserOptions) error
UpsertUser creates or updates a user.
type Permission ¶
type Permission uint8
Permission represents a permission a user may need for an operation.
const ( PermissionDataRead Permission = iota + 1 PermissionDataWrite PermissionUserRead PermissionUserManage PermissionViewsRead PermissionViewsManage PermissionDCPRead PermissionSearchRead PermissionSearchManage PermissionQueryRead PermissionQueryWrite PermissionQueryDelete PermissionQueryManage PermissionAnalyticsRead PermissionsAnalyticsManage PermissionSyncGateway PermissionStatsRead PermissionReplicationTarget PermissionReplicationManage PermissionClusterRead PermissionClusterManage PermissionBucketManage PermissionSettings PermissionSelect )
Various permissions which can be required.
type UpsertUserOptions ¶
type UpsertUserOptions struct { Username string DisplayName string // Roles are the roles assigned to the user that are of type "user". Roles []string Groups []string Password string }
UpsertUserOptions allows you to specify initial options for a new user.
type User ¶
type User struct { DisplayName string Username string Password string Groups []*Group Roles []*UserRole }
User represents a single user in the system.
func (*User) HasPermission ¶
func (u *User) HasPermission(permission Permission, bucket, scope, collection string) bool
HasPermission checks whether this user has a specific permission, including all roles and groups.
Click to show internal directories.
Click to hide internal directories.