Documentation ¶
Index ¶
- Constants
- type User
- func (u *User) GetPluginPermissions(name string) [][]byte
- func (u *User) HasApplicationAccess(satellite, cluster, namespace string, teams []string) bool
- func (u *User) HasPluginAccess(satellite, pluginType, pluginName string) bool
- func (u *User) HasResourceAccess(satellite, cluster, namespace, name, verb string) bool
- func (u *User) HasTeamAccess(teamGroup string) bool
- func (u *User) ToString() string
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 { Email string `json:"email"` Teams []string `json:"teams"` Permissions userv1.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) GetPluginPermissions ¶
GetPluginPermissions returns the custom plugin permissions for a user. For that the name of the plugin must be provided.
func (*User) HasApplicationAccess ¶
HasApplicationAccess checks if the user is allowed to view an application.
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.
func (*User) HasTeamAccess ¶
HasTeamAccess checks if the user is allowed to view a team. Teams are identified by the group property.