[v11.0.x] AuthN: Add IsAuthenticatedBy to identity interface and replace checks (#86321)

AuthN: Add IsAuthenticatedBy to identity interface and replace checks (#85262)

Add IsAuthenticatedBy to identity interface and replace checks

(cherry picked from commit 152cb47692)

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-16 14:41:15 +01:00
committed by GitHub
co-authored by Karl Persson
parent 6f87c9393e
commit 684aca803f
6 changed files with 23 additions and 3 deletions
@@ -141,7 +141,7 @@ func (f *accessControlDashboardPermissionFilter) buildClauses() {
// useSelfContainedPermissions is true if the user's permissions are stored and set from the JWT token
// currently it's used for the extended JWT module (when the user is authenticated via a JWT token generated by Grafana)
useSelfContainedPermissions := f.user.GetAuthenticatedBy() == login.ExtendedJWTModule
useSelfContainedPermissions := f.user.IsAuthenticatedBy(login.ExtendedJWTModule)
if len(f.dashboardActions) > 0 {
toCheck := actionsToCheck(f.dashboardActions, f.user.GetPermissions(), dashWildcards, folderWildcards)