Skip to content

Permit models other than user #7

@gil27

Description

@gil27

This gem was originally extracted from a project that has only user model using acl_manager. So a lot of things was hard coded to fit user model. it would be nice to allow other models different than user to use the gem.

eg:

lib/acl_manager/relationships.rb

module AclManager
  module Relationships
    extend ActiveSupport::Concern

    included do
      has_and_belongs_to_many :roles,
      class_name: AclManager::Role.name,
      join_table: 'acl_manager_roles_users',
      foreign_key: 'user_id',
      association_foreign_key: 'acl_manager_role_id'

      has_many :acls, through: :roles, class_name: AclManager::Acl.name
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions