mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AuthZ: Extend /api/search to work with self-contained permissions (#70749)
* Search sql filter draft, unfinished * Search works for empty roles * Add current AuthModule to SignedInUser * clean up, changes to the search * Use constant prefixes * Change AuthModule to AuthenticatedBy * Add tests for using the permissions from the SignedInUser * Refactor and simplify code * Fix sql generation for pg and mysql * Fixes, clean up * Add test for empty permission list * Fix * Fix any vs all in case of edit permission * Update pkg/services/authn/authn.go Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> * Update pkg/services/sqlstore/permissions/dashboard_test.go Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> * Fixes, changes based on the review --------- Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
@@ -146,15 +146,15 @@ func (c *OAuth) Authenticate(ctx context.Context, r *authn.Request) (*authn.Iden
|
||||
}
|
||||
|
||||
return &authn.Identity{
|
||||
Login: userInfo.Login,
|
||||
Name: userInfo.Name,
|
||||
Email: userInfo.Email,
|
||||
IsGrafanaAdmin: isGrafanaAdmin,
|
||||
AuthModule: c.moduleName,
|
||||
AuthID: userInfo.Id,
|
||||
Groups: userInfo.Groups,
|
||||
OAuthToken: token,
|
||||
OrgRoles: orgRoles,
|
||||
Login: userInfo.Login,
|
||||
Name: userInfo.Name,
|
||||
Email: userInfo.Email,
|
||||
IsGrafanaAdmin: isGrafanaAdmin,
|
||||
AuthenticatedBy: c.moduleName,
|
||||
AuthID: userInfo.Id,
|
||||
Groups: userInfo.Groups,
|
||||
OAuthToken: token,
|
||||
OrgRoles: orgRoles,
|
||||
ClientParams: authn.ClientParams{
|
||||
SyncUser: true,
|
||||
SyncTeams: true,
|
||||
|
Reference in New Issue
Block a user