docbrown/app/errors/authentication/errors.rb
Jacob Herrington a5b2d109d5
Rename banned and comment_banned roles (#12270)
* Rename banned and comment_banned roles

* Add data update script to rename roles containing 'ban'

* Add named error for Suspended users

* Update unidiomatic method names

* Rename misc banned to suspended

* Apply suggestions from code review

Co-authored-by: Michael Kohl <me@citizen428.net>

* Add unit tests for suspended methods

This commit also adds TODO comments for removing banned and
comment_banned from the codebase after data update scripts have
successfully run on all of our Forems.

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-04-06 10:12:14 -05:00

26 lines
818 B
Ruby

module Authentication
module Errors
PREVIOUSLY_SUSPENDED_MESSAGE = "It appears that your previous %<community_name>s " \
"account was suspended. As such, we've taken measures to prevent you from " \
"creating a new account with %<community_name>s and its community. If you " \
"think that there has been a mistake, please email us at %<community_email>s, " \
"and we will take another look.".freeze
class Error < StandardError
end
class ProviderNotFound < Error
end
class ProviderNotEnabled < Error
end
class PreviouslySuspended < Error
def message
format(PREVIOUSLY_SUSPENDED_MESSAGE,
community_name: SiteConfig.community_name,
community_email: SiteConfig.email_addresses[:contact])
end
end
end
end