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.2.9 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.8 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.7 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.6 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.5 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.4 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.3 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.2 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.1 lib/ibrain/permitted_attributes.rb
ibrain-core-0.2.0 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.9 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.8 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.7 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.6 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.5 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.4 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.3 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.2 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.1 lib/ibrain/permitted_attributes.rb
ibrain-core-0.1.0 lib/ibrain/permitted_attributes.rb