Make forbidden screen names configurable
This commit is contained in:
parent
fc161e2dcf
commit
5f60d86efe
|
@ -1,10 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ScreenNameValidator < ActiveModel::EachValidator
|
class ScreenNameValidator < ActiveModel::EachValidator
|
||||||
FORBIDDEN_SCREEN_NAMES = %w[justask_admin retrospring_admin admin justask retrospring about public
|
FORBIDDEN_SCREEN_NAMES = APP_CONFIG["forbidden_screen_names"].freeze
|
||||||
notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator
|
|
||||||
siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding
|
|
||||||
pixeidesu plxeldesu plxeidesu terms privacy linkfilter feedback].freeze
|
|
||||||
FORBIDDEN_SCREEN_NAME_REGEXPS = [/wreciap\z/i].freeze
|
FORBIDDEN_SCREEN_NAME_REGEXPS = [/wreciap\z/i].freeze
|
||||||
|
|
||||||
def validate_each(record, attribute, value)
|
def validate_each(record, attribute, value)
|
||||||
|
|
|
@ -9,6 +9,23 @@ email_from: "noreply@justask.rrerr.net"
|
||||||
# Name of the "Anonymous" user. (e.g. "Anonymous Coward", "Arno Nym", "Mr. X", ...)
|
# Name of the "Anonymous" user. (e.g. "Anonymous Coward", "Arno Nym", "Mr. X", ...)
|
||||||
anonymous_name: "Anonymous"
|
anonymous_name: "Anonymous"
|
||||||
|
|
||||||
|
forbidden_screen_names:
|
||||||
|
- justask_admin
|
||||||
|
- retrospring_admin
|
||||||
|
- admin
|
||||||
|
- justask
|
||||||
|
- retrospring
|
||||||
|
- moderation
|
||||||
|
- moderator
|
||||||
|
- mod
|
||||||
|
- administrator
|
||||||
|
- siteadmin
|
||||||
|
- site_admin
|
||||||
|
- help
|
||||||
|
- retro_spring
|
||||||
|
- retroospring
|
||||||
|
- retrosprlng
|
||||||
|
|
||||||
# Text shown on the about page (Markdown can be used here)
|
# Text shown on the about page (Markdown can be used here)
|
||||||
about: |
|
about: |
|
||||||
# About
|
# About
|
||||||
|
|
Loading…
Reference in New Issue