X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b5995c5175b2fbc6743d4faeb404ad6cefb006ec..d104736809d9e36b0bc955f3425c4d47a370e78b:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index f804f4666..7571dd9dc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -115,6 +115,7 @@ class User < ApplicationRecord alias_attribute :created_at, :creation_time + after_initialize :encrypt_password before_save :encrypt_password before_save :update_tile after_save :spam_check @@ -290,6 +291,12 @@ class User < ApplicationRecord role? "administrator" end + ## + # returns true if the user has the importer role, false otherwise + def importer? + role? "importer" + end + ## # returns true if the user has the requested role def role?(role)