mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
21 lines
423 B
Ruby
21 lines
423 B
Ruby
class User < ApplicationRecord
|
|
has_secure_password
|
|
has_many :organization_users
|
|
belongs_to :organization
|
|
has_many :app_users
|
|
|
|
validates :email, presence: true, uniqueness: true
|
|
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP }
|
|
|
|
def admin?
|
|
role == "admin"
|
|
end
|
|
|
|
def developer?
|
|
role == "developer"
|
|
end
|
|
|
|
def viewer?
|
|
role == "viewer"
|
|
end
|
|
end
|