Sha256: f72ebc88f2d4b8bdda975b8b2123634a213cb1c0eb538cb4919942a936f78133

Contents?: true

Size: 1.77 KB

Versions: 9

Compression:

Stored size: 1.77 KB

Contents

# frozen_string_literal: true

Monarchy.configure do |config|
  # REQUIRED SETTINGS

  # You have to define which role will be the default one (read only) during inheritance.
  # Example role: :guest
  # Real case on resources:
  # project: (you have no roles)
  #   section: (you have no roles)
  #     task: (you have a member role here)
  # When you ask for user.roles_for(project) you will get a default role (:guest)
  # in case when member role has inherited flag set to true
  # Remember to create that role before setting it up eg:
  # Monarchy::Role.create(name: :guest, inherited: false, level: 0)
  config.inherited_default_role = :guest # symbol

  # You have to define user class name or an actor class which respond to acts_as_user in your model.
  # Example of model:
  # class User < ActiveRecord::Base
  #   acts_as_user
  # end
  config.user_class_name = 'User' # string

  # OPTIONAL SETTINGS

  # If you want to override Member or Role class you have add correct actors to class definition
  # Available: acts_as_member, acts_as_role
  # Example:
  # class Member < ActiveRecord::Base
  #   acts_as_member
  # end
  config.member_class_name = 'Member' # string
  config.role_class_name = 'Role' # string

  # If this option is setup to true all members bellow the destroying one, will be deleted.
  config.members_access_revoke = true # boolean

  # Set the revoke strategy using during '#revoke_role!' method
  # Available: :revoke_member, :revoke_access
  # Default: :revoke_member
  # Info:
  # :revoke_member - after revoking the last role from user's member remove the member
  # :revoke_member - after revoking the last role from user's member
  #                  remove the member, and all members bellow which belongs to the user
  config.revoke_strategy = :revoke_member # symbol
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
monarchy-2.7.0 dummy/config/initializers/monarchy.rb
monarchy-2.6.1 dummy/config/initializers/monarchy.rb
monarchy-2.6.0 dummy/config/initializers/monarchy.rb
monarchy-2.5.0 dummy/config/initializers/monarchy.rb
monarchy-2.4.0 dummy/config/initializers/monarchy.rb
monarchy-2.3.0 dummy/config/initializers/monarchy.rb
monarchy-2.2.2 dummy/config/initializers/monarchy.rb
monarchy-2.2.1 dummy/config/initializers/monarchy.rb
monarchy-2.2.0 dummy/config/initializers/monarchy.rb