Add consumable invites (#5814)
* Add consumable invites * Add UI for generating invite codes * Add tests * Display max uses and expiration in invites table, delete invite * Remove unused column and redundant validator - Default follows not used, probably bad idea - InviteCodeValidator is redundant because RegistrationsController checks invite code validity * Add admin setting to disable invites * Add admin UI for invites, configurable role for invite creation - Admin UI that lists everyone's invites, always available - Admin setting min_invite_role to control who can invite people - Non-admin invite UI only visible if users are allowed to * Do not remove invites from database, expire them instantly
This commit is contained in:
parent
0ea4478b68
commit
740f8a95a9
28 changed files with 439 additions and 5 deletions
|
@ -22,6 +22,10 @@ Rails.application.routes.draw do
|
|||
get 'manifest', to: 'manifests#show', defaults: { format: 'json' }
|
||||
get 'intent', to: 'intents#show'
|
||||
|
||||
devise_scope :user do
|
||||
get '/invite/:invite_code', to: 'auth/registrations#new', as: :public_invite
|
||||
end
|
||||
|
||||
devise_for :users, path: 'auth', controllers: {
|
||||
sessions: 'auth/sessions',
|
||||
registrations: 'auth/registrations',
|
||||
|
@ -99,6 +103,7 @@ Rails.application.routes.draw do
|
|||
resources :media, only: [:show]
|
||||
resources :tags, only: [:show]
|
||||
resources :emojis, only: [:show]
|
||||
resources :invites, only: [:index, :create, :destroy]
|
||||
|
||||
get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy
|
||||
|
||||
|
@ -112,6 +117,7 @@ Rails.application.routes.draw do
|
|||
resources :email_domain_blocks, only: [:index, :new, :create, :destroy]
|
||||
resources :action_logs, only: [:index]
|
||||
resource :settings, only: [:edit, :update]
|
||||
resources :invites, only: [:index, :create, :destroy]
|
||||
|
||||
resources :instances, only: [:index] do
|
||||
collection do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue