Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] [buddy] Fix denying access despite access being configured for Notification Routing Rules in the web UI #44028

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/services/useracl.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func NewUserACL(user types.User, userRoles RoleSet, features proto.Features, des
dbAccess := newAccess(userRoles, ctx, types.KindDatabase)
kubeServerAccess := newAccess(userRoles, ctx, types.KindKubeServer)
requestAccess := newAccess(userRoles, ctx, types.KindAccessRequest)
accessMonitoringRules := newAccess(userRoles, ctx, types.KindAccessMonitoringRule)
desktopAccess := newAccess(userRoles, ctx, types.KindWindowsDesktop)
cnDiagnosticAccess := newAccess(userRoles, ctx, types.KindConnectionDiagnostic)
samlIdpServiceProviderAccess := newAccess(userRoles, ctx, types.KindSAMLIdPServiceProvider)
Expand Down Expand Up @@ -202,11 +203,9 @@ func NewUserACL(user types.User, userRoles RoleSet, features proto.Features, des

var auditQuery ResourceAccess
var securityReports ResourceAccess
var accessMonitoringRules ResourceAccess
if accessMonitoringEnabled {
auditQuery = newAccess(userRoles, ctx, types.KindAuditQuery)
securityReports = newAccess(userRoles, ctx, types.KindSecurityReport)
accessMonitoringRules = newAccess(userRoles, ctx, types.KindAccessMonitoringRule)
}

return UserACL{
Expand Down
2 changes: 2 additions & 0 deletions lib/services/useracl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func TestNewUserACL(t *testing.T) {
require.Empty(t, cmp.Diff(userContext.Tokens, denied))
require.Empty(t, cmp.Diff(userContext.Nodes, denied))
require.Empty(t, cmp.Diff(userContext.AccessRequests, denied))
require.Empty(t, cmp.Diff(userContext.AccessMonitoringRule, denied))
require.Empty(t, cmp.Diff(userContext.ConnectionDiagnostic, denied))
require.Empty(t, cmp.Diff(userContext.Desktops, allowedRW))
require.Empty(t, cmp.Diff(userContext.ExternalAuditStorage, denied))
Expand Down Expand Up @@ -152,6 +153,7 @@ func TestNewUserACLCloud(t *testing.T) {
require.Empty(t, cmp.Diff(userContext.Tokens, allowedRW))
require.Empty(t, cmp.Diff(userContext.Nodes, allowedRW))
require.Empty(t, cmp.Diff(userContext.AccessRequests, allowedRW))
require.Empty(t, cmp.Diff(userContext.AccessMonitoringRule, allowedRW))
require.Empty(t, cmp.Diff(userContext.DiscoveryConfig, allowedRW))
require.Empty(t, cmp.Diff(userContext.ExternalAuditStorage, allowedRW))
require.Empty(t, cmp.Diff(userContext.Bots, allowedRW))
Expand Down
Loading