mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:35:15 +08:00
Authn: Add function to resolve identity from org and namespace id (#84555)
* Add function to get the namespaced id * Add function to resolve an identity through authn.Service from org and namespace id * Switch to resolve identity for re-authenticate in another org
This commit is contained in:
@ -326,11 +326,11 @@ func (hs *HTTPServer) searchOrgUsersHelper(c *contextmodel.ReqContext, query *or
|
||||
if c.QueryBool("accesscontrol") {
|
||||
permissions := c.SignedInUser.GetPermissions()
|
||||
if query.OrgID != c.SignedInUser.GetOrgID() {
|
||||
permissionsList, err := hs.accesscontrolService.GetUserPermissionsInOrg(c.Req.Context(), c.SignedInUser, query.OrgID)
|
||||
identity, err := hs.authnService.ResolveIdentity(c.Req.Context(), query.OrgID, c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
permissions = accesscontrol.GroupScopesByAction(permissionsList)
|
||||
permissions = identity.GetPermissions()
|
||||
}
|
||||
accessControlMetadata = accesscontrol.GetResourcesMetadata(c.Req.Context(), permissions, "users:id:", userIDs)
|
||||
}
|
||||
|
Reference in New Issue
Block a user