Documentation ¶
Index ¶
Constants ¶
const UserKey ctxKeyUser = 0
UserKey is the key that holds the user in a request context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID string `json:"id"` HasProfile bool `json:"hasProfile"` Profile user.UserSpec `json:"profile,omitempty"` Permissions team.Permissions `json:"permissions"` }
User is the structure of the user object saved in the request context. It contains the users id and permissions if authentication is enabled.
func GetUser ¶
GetUser returns a user from the given context if one is present. Returns the empty string if a user can not be found.
func (*User) HasClusterAccess ¶
HasClusterAccess checks if the user has access to the given cluster.
func (*User) HasNamespaceAccess ¶
HasNamespaceAccess checks if the user has access to the given namespace in the given cluster.
func (*User) HasPluginAccess ¶
HasPluginAccess checks if the user has access to the given plugin.
func (*User) HasResourceAccess ¶
HasResourceAccess checks if the user has access to the given resource in the given cluster and namespace.