adds cliipboard to userACL (#10207)

This commit is contained in:
Isaiah Becker-Mayer
2022-02-08 14:24:16 +00:00
committed by GitHub
parent 154d6fbf97
commit e8cd8fa040
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -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
+2
View File
@@ -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)