Sha256: 535d2193761439a6f631951518201fc7c33b87369dcc1cb7c2003b6511062ab4

Contents?: true

Size: 982 Bytes

Versions: 60

Compression:

Stored size: 982 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  # Ibrain::PermittedAttributes contains the attributes permitted through strong
  # params in various controllers in the frontend. Extensions and stores that
  # need additional params to be accepted can mutate these arrays to add them.
  module PermittedAttributes
    ATTRIBUTES = [
      :address_attributes,
      :user_attributes
    ]

    mattr_reader(*ATTRIBUTES)

    @@address_attributes = [
      :id, :name, :address1, :address2, :city, :country_id, :state_id,
      :zipcode, :phone, :state_name, :province_id, :ward_id, :district_id
    ]

    # Intentionally leaving off email here to prevent privilege escalation
    # by changing a user with higher priveleges' email to one a lower-priveleged
    # admin owns. Creating a user with an email is handled separate at the
    # controller level.
    @@user_attributes = [:name, :email, :provider, :uid, :first_name, :last_name, :password, :password_confirmation]
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
ibrain-core-0.5.15 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.13 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.12 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.10 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.9 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.8 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.7 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.6 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.5 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.4 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.3 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.2 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.1 lib/ibrain/permitted_attributes.rb
ibrain-core-0.5.0 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.9 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.8 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.7 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.5 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.4 lib/ibrain/permitted_attributes.rb
ibrain-core-0.4.3 lib/ibrain/permitted_attributes.rb