mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Bookmarks: Do not show on navigation or button for unauthed users (#96836)
This commit is contained in:
@@ -172,7 +172,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
||||
treeRoot.RemoveSectionByID(navtree.NavIDCfg)
|
||||
}
|
||||
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) {
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) && c.IsSignedIn {
|
||||
treeRoot.AddSection(&navtree.NavLink{
|
||||
Text: "Bookmarks",
|
||||
Id: navtree.NavIDBookmarks,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Icon, IconButton, Link, useTheme2 } from '@grafana/ui';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
export interface Props {
|
||||
children: React.ReactNode;
|
||||
@@ -50,7 +51,7 @@ export function MegaMenuItemText({ children, isActive, onClick, target, url, onP
|
||||
>
|
||||
{linkContent}
|
||||
</LinkComponent>
|
||||
{config.featureToggles.pinNavItems && url && url !== '/bookmarks' && (
|
||||
{config.featureToggles.pinNavItems && contextSrv.isSignedIn && url && url !== '/bookmarks' && (
|
||||
<IconButton
|
||||
name="bookmark"
|
||||
className={'pin-icon'}
|
||||
|
||||
Reference in New Issue
Block a user