refactoring: Dashboard guardian

This commit is contained in:
Torkel Ödegaard
2017-06-16 21:25:24 -04:00
parent d9dca72ee4
commit 3fe031d25d
6 changed files with 119 additions and 19 deletions
+8
View File
@@ -162,6 +162,14 @@ type SignedInUser struct {
HelpFlags1 HelpFlags1
}
func (user *SignedInUser) HasRole(role RoleType) bool {
if user.IsGrafanaAdmin {
return true
}
return user.OrgRole.Includes(role)
}
type UserProfileDTO struct {
Email string `json:"email"`
Name string `json:"name"`