Auth: Move LDAP debug to Authentication menu (#71285)

* move LDAP page to Authentication

* tweak Auth menu showing permissions
This commit is contained in:
Jo
2023-07-12 18:15:02 +02:00
committed by GitHub
parent 3a45f02ef3
commit 9b22342b91
5 changed files with 23 additions and 21 deletions
+2 -8
View File
@@ -121,12 +121,6 @@ func (s *ServiceImpl) getAdminNode(c *contextmodel.ReqContext) (*navtree.NavLink
})
}
if s.cfg.LDAPAuthEnabled && hasAccess(ac.EvalPermission(ac.ActionLDAPStatusRead)) {
configNodes = append(configNodes, &navtree.NavLink{
Text: "LDAP", Id: "ldap", Url: s.cfg.AppSubURL + "/admin/ldap", Icon: "book",
})
}
if hasAccess(ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsAll)) && s.features.IsEnabled(featuremgmt.FlagStorage) {
storage := &navtree.NavLink{
Text: "Storage",
@@ -157,8 +151,8 @@ func enableServiceAccount(s *ServiceImpl, c *contextmodel.ReqContext) bool {
}
func evalAuthenticationSettings() ac.Evaluator {
return ac.EvalAll(
return ac.EvalAny(ac.EvalAll(
ac.EvalPermission(ac.ActionSettingsWrite, ac.ScopeSettingsSAML),
ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsSAML),
)
), ac.EvalPermission(ac.ActionLDAPStatusRead))
}