FEATURE: Introduce API scopes for badges.

This commit is contained in:
Alan Guo Xiang Tan
2021-12-06 10:27:25 +08:00
parent f3508065a3
commit 44588255fc
3 changed files with 18 additions and 1 deletions

View File

@@ -51,6 +51,15 @@ class ApiKeyScope < ActiveRecord::Base
},
email: {
receive_emails: { actions: %w[admin/email#handle_mail] }
},
badges: {
create: { actions: %w[admin/badges#create] },
show: { actions: %w[badges#show] },
update: { actions: %w[admin/badges#update] },
delete: { actions: %w[admin/badges#destroy] },
list_user_badges: { actions: %w[user_badges#username], params: %i[username] },
assign_badge_to_user: { actions: %w[user_badges#create], params: %i[username] },
revoke_badge_from_user: { actions: %w[user_badges#destroy] },
}
}