Skip to content
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
7 changes: 5 additions & 2 deletions lib/auth/auth_with_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -6303,8 +6303,11 @@ func (a *ServerWithRoles) GetLicense(ctx context.Context) (string, error) {

// ListReleases return Teleport Enterprise releases
func (a *ServerWithRoles) ListReleases(ctx context.Context) ([]*types.Release, error) {
if err := a.action(apidefaults.Namespace, types.KindDownload, types.VerbList); err != nil {
return nil, trace.Wrap(err)
// on Cloud, any user is allowed to list releases
if !modules.GetModules().Features().Cloud {
if err := a.action(apidefaults.Namespace, types.KindDownload, types.VerbList); err != nil {
return nil, trace.Wrap(err)
}
}

return a.authServer.releaseService.ListReleases(ctx)
Expand Down
14 changes: 11 additions & 3 deletions web/packages/teleport/src/stores/storeUserContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,22 @@ export default class StoreUserContext extends Store<UserContext> {
// has access to download either teleport binaries or the license.
// Since the page is used to download both of them, having access to one
// is enough to show access this page.
// This page is only available for `dashboards`.
// This page is only available for `dashboards` and cloud customers.
hasDownloadCenterListAccess() {
return (
cfg.isDashboard &&
(this.state.acl.license.read || this.state.acl.download.list)
cfg.isCloud ||
(cfg.isDashboard &&
(this.state.acl.license.read || this.state.acl.download.list))
Comment thread
mcbattirola marked this conversation as resolved.
);
}

// hasSupportPageLinkAccess checks if the user
// has access to a Support external link in the side menu.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avatus is in the middle of removing the side bar, was the dashboard view discussed with this refactor?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is now in master btw: #36368

You may need to update how this is displayed @mcbattirola

Copy link
Copy Markdown
Contributor Author

@mcbattirola mcbattirola Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out, I wasn't aware of the new topbar.

I've talked with Kenny, we'll be changing some stuff around:

Since this PR doesn't introduce the top bar link, only changes the show condition, I think we can merge this and implement the changes listed above in a new PR.

// This should only be displayed on `dashboards`.
hasSupportPageLinkAccess() {
return cfg.isDashboard;
}

// hasAccessToAgentQuery checks for at least one valid query permission.
// Nodes require only a 'list' access while the rest of the agents
// require 'list + read'.
Expand Down
2 changes: 2 additions & 0 deletions web/packages/teleport/src/teleportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class TeleportContext implements types.Context {
accessRequests: hasAccessRequestsAccess(),
newAccessRequest: userContext.getAccessRequestAccess().create,
downloadCenter: userContext.hasDownloadCenterListAccess(),
supportLink: userContext.hasSupportPageLinkAccess(),
discover: userContext.hasDiscoverAccess(),
plugins: userContext.getPluginsAccess().list,
integrations: userContext.getIntegrationsAccess().list,
Expand Down Expand Up @@ -234,6 +235,7 @@ export const disabledFeatureFlags: types.FeatureFlags = {
newAccessRequest: false,
accessRequests: false,
downloadCenter: false,
supportLink: false,
discover: false,
plugins: false,
integrations: false,
Expand Down
1 change: 1 addition & 0 deletions web/packages/teleport/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export interface FeatureFlags {
accessRequests: boolean;
newAccessRequest: boolean;
downloadCenter: boolean;
supportLink: boolean;
discover: boolean;
plugins: boolean;
integrations: boolean;
Expand Down