Sha256: ed587969309e3108f4c19ebbfa721e556dc4cb63220947b01fc998809fe5866b

Contents?: true

Size: 619 Bytes

Versions: 7

Compression:

Stored size: 619 Bytes

Contents

module Abilities
    class ThecoreUiRailsAdmin
        include CanCan::Ability
        def initialize user
            # No one is allowed to add or destroy settings
            # just list or edit existing
            cannot :create, ThecoreSettings::Setting
            cannot :destroy, ThecoreSettings::Setting
            cannot :show, ThecoreSettings::Setting
            # Main abilities file for Thecore applications
            if user.present?
                # Users' abilities
                if user.admin?
                    # Admins' abilities
                end
            end
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thecore_ui_rails_admin-3.0.18 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.17 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.16 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.15 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.14 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.13 config/initializers/abilities.rb
thecore_ui_rails_admin-3.0.12 config/initializers/abilities.rb