1
0
mirror of https://github.com/rancher/types.git synced 2025-09-13 13:33:06 +00:00

Move UserManager to user.Manager and store in contexts

This commit is contained in:
Darren Shepherd
2018-03-02 11:49:51 -07:00
parent 35269599bf
commit a66b99ac07
2 changed files with 16 additions and 12 deletions

13
user/manager.go Normal file
View File

@@ -0,0 +1,13 @@
package user
import (
"github.com/rancher/norman/types"
"github.com/rancher/types/apis/management.cattle.io/v3"
)
type Manager interface {
SetPrincipalOnCurrentUser(apiContext *types.APIContext, principal v3.Principal) (*v3.User, error)
GetUser(apiContext *types.APIContext) string
EnsureUser(principalName, displayName string) (*v3.User, error)
CheckAccess(accessMode string, allowedPrincipalIDs []string, user v3.Principal, groups []v3.Principal) (bool, error)
}