mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-24 16:17:11 +08:00
adds cliipboard to userACL (#10207)
This commit is contained in:
@@ -82,6 +82,8 @@ type userACL struct {
|
||||
AccessRequests access `json:"accessRequests"`
|
||||
// Billing defines access to billing information.
|
||||
Billing access `json:"billing"`
|
||||
// Clipboard defines whether the user can use a shared clipboard during windows desktop sessions.
|
||||
Clipboard bool `json:"clipboard"`
|
||||
}
|
||||
|
||||
type authType string
|
||||
@@ -220,6 +222,7 @@ func NewUserContext(user types.User, userRoles services.RoleSet, features proto.
|
||||
logins := getLogins(userRoles)
|
||||
accessStrategy := getAccessStrategy(userRoles)
|
||||
windowsLogins := getWindowsDesktopLogins(userRoles)
|
||||
clipboard := userRoles.DesktopClipboard()
|
||||
|
||||
acl := userACL{
|
||||
AccessRequests: requestAccess,
|
||||
@@ -238,6 +241,7 @@ func NewUserContext(user types.User, userRoles services.RoleSet, features proto.
|
||||
Tokens: tokenAccess,
|
||||
Nodes: nodeAccess,
|
||||
Billing: billingAccess,
|
||||
Clipboard: clipboard,
|
||||
}
|
||||
|
||||
// local user
|
||||
|
||||
@@ -111,6 +111,7 @@ func (s *UserContextSuite) TestNewUserContext(c *check.C) {
|
||||
Prompt: "",
|
||||
})
|
||||
c.Assert(userContext.ACL.Billing, check.DeepEquals, denied)
|
||||
c.Assert(userContext.ACL.Clipboard, check.Equals, true)
|
||||
|
||||
// test local auth type
|
||||
c.Assert(userContext.AuthType, check.Equals, authLocal)
|
||||
@@ -174,6 +175,7 @@ func (s *UserContextSuite) TestNewUserContextCloud(c *check.C) {
|
||||
Type: types.RequestStrategyOptional,
|
||||
Prompt: "",
|
||||
})
|
||||
c.Assert(userContext.ACL.Clipboard, check.Equals, true)
|
||||
|
||||
// cloud-specific asserts
|
||||
c.Assert(userContext.ACL.Billing, check.DeepEquals, allowed)
|
||||
|
||||
Reference in New Issue
Block a user