FEATURE: Add API scopes for group endpoints (#20401)

Added two new api scopes for managing and administering groups.

See https://meta.discourse.org/t/249710
This commit is contained in:
Blake Erickson 2023-02-22 09:06:49 -07:00 committed by GitHub
parent 8d2fa1c184
commit 51a7cd899e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -158,6 +158,21 @@ class ApiKeyScope < ActiveRecord::Base
actions: %w[user_badges#destroy], actions: %w[user_badges#destroy],
}, },
}, },
groups: {
manage_groups: {
actions: %w[groups#members groups#add_members groups#remove_members],
params: %i[id],
},
administer_groups: {
actions: %w[
admin/groups#create
admin/groups#destroy
groups#show
groups#update
groups#index
],
},
},
search: { search: {
show: { show: {
actions: %w[search#show], actions: %w[search#show],

View File

@ -4736,6 +4736,9 @@ en:
list_user_badges: List user badges. list_user_badges: List user badges.
assign_badge_to_user: Assign a badge to a user. assign_badge_to_user: Assign a badge to a user.
revoke_badge_from_user: Revoke a badge from a user. revoke_badge_from_user: Revoke a badge from a user.
groups:
manage_groups: List, add, and remove group members.
administer_groups: List, show, create, update, and delete groups.
search: search:
show: Search using the `/search.json?q=term` endpoint. show: Search using the `/search.json?q=term` endpoint.
query: Search using the `/search/query?term=term` endpoint. query: Search using the `/search/query?term=term` endpoint.

View File

@ -427,6 +427,7 @@ RSpec.describe Admin::ApiController do
"user_status", "user_status",
"global", "global",
"badges", "badges",
"groups",
"categories", "categories",
"search", "search",
"invites", "invites",