Authorization: Add group to role DisplayName to make filtered list more clear (#102950)
* add group to role DisplayName to make searching easier * clean up more role names; add filtered display text when fetching * pass filter state into role menu to decide how to display role name * prop name better describes what it does
This commit is contained in:
@@ -163,8 +163,8 @@ func ProvideDashboardPermissions(
|
||||
"Edit": getDashboardEditActions(features),
|
||||
"Admin": getDashboardAdminActions(features),
|
||||
},
|
||||
ReaderRoleName: "Dashboard permission reader",
|
||||
WriterRoleName: "Dashboard permission writer",
|
||||
ReaderRoleName: "Permission reader",
|
||||
WriterRoleName: "Permission writer",
|
||||
RoleGroup: "Dashboards",
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ func ProvideFolderPermissions(
|
||||
"Edit": append(getDashboardEditActions(features), FolderEditActions...),
|
||||
"Admin": append(getDashboardAdminActions(features), FolderAdminActions...),
|
||||
},
|
||||
ReaderRoleName: "Folder permission reader",
|
||||
WriterRoleName: "Folder permission writer",
|
||||
ReaderRoleName: "Permission reader",
|
||||
WriterRoleName: "Permission writer",
|
||||
RoleGroup: "Folders",
|
||||
}
|
||||
srv, err := resourcepermissions.New(cfg, options, features, router, license, accesscontrol, service, sql, teamService, userService, actionSetService)
|
||||
|
||||
@@ -67,8 +67,8 @@ func ProvideServiceAccountPermissions(
|
||||
"Edit": ServiceAccountEditActions,
|
||||
"Admin": ServiceAccountAdminActions,
|
||||
},
|
||||
ReaderRoleName: "Service account permission reader",
|
||||
WriterRoleName: "Service account permission writer",
|
||||
ReaderRoleName: "Permission reader",
|
||||
WriterRoleName: "Permission writer",
|
||||
RoleGroup: "Service accounts",
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +78,8 @@ func ProvideTeamPermissions(
|
||||
"Member": TeamMemberActions,
|
||||
"Admin": TeamAdminActions,
|
||||
},
|
||||
ReaderRoleName: "Team permission reader",
|
||||
WriterRoleName: "Team permission writer",
|
||||
ReaderRoleName: "Permission reader",
|
||||
WriterRoleName: "Permission writer",
|
||||
RoleGroup: "Teams",
|
||||
OnSetUser: func(session *db.Session, orgID int64, user accesscontrol.User, resourceID, permission string) error {
|
||||
teamId, err := strconv.ParseInt(resourceID, 10, 64)
|
||||
|
||||
@@ -43,7 +43,7 @@ const (
|
||||
var (
|
||||
ldapReaderRole = RoleDTO{
|
||||
Name: "fixed:ldap:reader",
|
||||
DisplayName: "LDAP reader",
|
||||
DisplayName: "Reader",
|
||||
Description: "Read LDAP configuration and status.",
|
||||
Group: "LDAP",
|
||||
Permissions: []Permission{
|
||||
@@ -58,7 +58,7 @@ var (
|
||||
|
||||
ldapWriterRole = RoleDTO{
|
||||
Name: "fixed:ldap:writer",
|
||||
DisplayName: "LDAP writer",
|
||||
DisplayName: "Writer",
|
||||
Description: "Read and update LDAP configuration and read LDAP status.",
|
||||
Group: "LDAP",
|
||||
Permissions: ConcatPermissions(ldapReaderRole.Permissions, []Permission{
|
||||
@@ -73,9 +73,9 @@ var (
|
||||
|
||||
orgUsersWriterRole = RoleDTO{
|
||||
Name: "fixed:org.users:writer",
|
||||
DisplayName: "Organization user writer",
|
||||
DisplayName: "Writer (organizational)",
|
||||
Description: "Within a single organization, add a user, invite a user, read information about a user and their role, remove a user from that organization, or change the role of a user.",
|
||||
Group: "User administration (organizational)",
|
||||
Group: "User administration",
|
||||
Permissions: ConcatPermissions(orgUsersReaderRole.Permissions, []Permission{
|
||||
{
|
||||
Action: ActionOrgUsersAdd,
|
||||
@@ -94,9 +94,9 @@ var (
|
||||
|
||||
orgUsersReaderRole = RoleDTO{
|
||||
Name: "fixed:org.users:reader",
|
||||
DisplayName: "Organization user reader",
|
||||
DisplayName: "Reader (organizational)",
|
||||
Description: "Read users within a single organization.",
|
||||
Group: "User administration (organizational)",
|
||||
Group: "User administration",
|
||||
Permissions: []Permission{
|
||||
{
|
||||
Action: ActionOrgUsersRead,
|
||||
@@ -111,7 +111,7 @@ var (
|
||||
|
||||
SettingsReaderRole = RoleDTO{
|
||||
Name: "fixed:settings:reader",
|
||||
DisplayName: "Setting reader",
|
||||
DisplayName: "Reader",
|
||||
Description: "Read Grafana instance settings.",
|
||||
Group: "Settings",
|
||||
Permissions: []Permission{
|
||||
@@ -124,7 +124,7 @@ var (
|
||||
|
||||
statsReaderRole = RoleDTO{
|
||||
Name: "fixed:stats:reader",
|
||||
DisplayName: "Statistics reader",
|
||||
DisplayName: "Reader",
|
||||
Description: "Read Grafana instance statistics.",
|
||||
Group: "Statistics",
|
||||
Permissions: []Permission{
|
||||
@@ -136,9 +136,9 @@ var (
|
||||
|
||||
usersReaderRole = RoleDTO{
|
||||
Name: "fixed:users:reader",
|
||||
DisplayName: "User reader",
|
||||
DisplayName: "Reader (global)",
|
||||
Description: "Read all users and their information, such as team memberships, authentication tokens, and quotas.",
|
||||
Group: "User administration (global)",
|
||||
Group: "User administration",
|
||||
Permissions: []Permission{
|
||||
{
|
||||
Action: ActionUsersRead,
|
||||
@@ -157,9 +157,9 @@ var (
|
||||
|
||||
usersWriterRole = RoleDTO{
|
||||
Name: "fixed:users:writer",
|
||||
DisplayName: "User writer",
|
||||
DisplayName: "Writer (global)",
|
||||
Description: "Read and update all attributes and settings for all users in Grafana: update user information, read user information, create or enable or disable a user, make a user a Grafana administrator, sign out a user, update a user’s authentication token, or update quotas for all users.",
|
||||
Group: "User administration (global)",
|
||||
Group: "User administration",
|
||||
Permissions: ConcatPermissions(usersReaderRole.Permissions, []Permission{
|
||||
{
|
||||
Action: ActionUsersPasswordUpdate,
|
||||
@@ -295,7 +295,7 @@ var (
|
||||
|
||||
usagestatsReaderRole = RoleDTO{
|
||||
Name: "fixed:usagestats:reader",
|
||||
DisplayName: "Usage stats report reader",
|
||||
DisplayName: "Usage report reader",
|
||||
Description: "View usage statistics report",
|
||||
Group: "Statistics",
|
||||
Permissions: []Permission{
|
||||
|
||||
Reference in New Issue
Block a user