Sha256: 7e9b6fdd36f0be7e50f258d94d0d18017a0f87d142940c2773d143371dbc6fcf

Contents?: true

Size: 674 Bytes

Versions: 8

Compression:

Stored size: 674 Bytes

Contents

module Scidea
  module Schools
    module Models
      module Ability
        extend ActiveSupport::Concern

        module InstanceMethods
          def initialize_namespace_admin(user)
            super

            can(:manage, [School]) if user.has_role?(Role.course_admin)
          end

          def initialize_namespace_none(user)
            super

            # required for registration form              
            can([:index, :create, :update], School) 

            # required for profile form
            can([:index, :create, :update], School) if user.has_role? Role.learner
          end
        end      

      end # ability
    end # models
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scidea-schools-1.1 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.6 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.5 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.4 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.3 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.2 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.1 lib/scidea/schools/models/ability.rb
scidea-schools-1.0.0 lib/scidea/schools/models/ability.rb