mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Implement requester interface in access control module (#74289)
* Implement requester interface in the access control module
This commit is contained in:
@@ -46,11 +46,14 @@ func (u *SignedInUser) NameOrFallback() string {
|
||||
// TODO: There's a need to remove this struct since it creates a circular dependency
|
||||
|
||||
// DEPRECATED: This function uses `UserDisplayDTO` model which we want to remove
|
||||
// In order to retrieve the user URL, we need the dto library. However, adding
|
||||
// the dto library to the user service creates a circular dependency
|
||||
func (u *SignedInUser) ToUserDisplayDTO() *UserDisplayDTO {
|
||||
return &UserDisplayDTO{
|
||||
ID: u.UserID,
|
||||
Login: u.Login,
|
||||
Name: u.Name,
|
||||
// AvatarURL: dtos.GetGravatarUrl(u.GetEmail()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,3 +203,8 @@ func (u *SignedInUser) GetEmail() string {
|
||||
func (u *SignedInUser) GetDisplayName() string {
|
||||
return u.NameOrFallback()
|
||||
}
|
||||
|
||||
// DEPRECATEAD: Returns the authentication method used
|
||||
func (u *SignedInUser) GetAuthenticatedBy() string {
|
||||
return u.AuthenticatedBy
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/auth/identity"
|
||||
)
|
||||
|
||||
type HelpFlags1 uint64
|
||||
@@ -104,7 +106,7 @@ type SetUsingOrgCommand struct {
|
||||
}
|
||||
|
||||
type SearchUsersQuery struct {
|
||||
SignedInUser *SignedInUser
|
||||
SignedInUser identity.Requester
|
||||
OrgID int64 `xorm:"org_id"`
|
||||
Query string
|
||||
Page int
|
||||
|
||||
Reference in New Issue
Block a user