Sha256: 24106e43ff4fc202220be3570b57bde6ee629c8427d0d5839d0b0005d091b2dc

Contents?: true

Size: 525 Bytes

Versions: 54

Compression:

Stored size: 525 Bytes

Contents

module Faalis
  module API
    class PermissionsAPI < Grape::API

      resource :permissions do

        desc "Return all permissions available"
        get do
          authenticated_user
          # TODO: Check for admin user only
          permissions = []

          Faalis::Engine.models_with_permission.each do |model|
            model = Object.const_get(model)
            permissions.concat(model::Permissions.permission_strings(model))
          end

          permissions
        end
      end

    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
faalis-2.2.0.pre.rc1 lib/faalis/api/permissions_api.rb
faalis-2.2.1 lib/faalis/api/permissions_api.rb
faalis-2.2.0 lib/faalis/api/permissions_api.rb
faalis-2.1.1 lib/faalis/api/permissions_api.rb
faalis-2.1.0 lib/faalis/api/permissions_api.rb
faalis-2.0.8 lib/faalis/api/permissions_api.rb
faalis-2.0.7 lib/faalis/api/permissions_api.rb
faalis-2.0.5 lib/faalis/api/permissions_api.rb
faalis-2.0.4 lib/faalis/api/permissions_api.rb
faalis-2.0.3 lib/faalis/api/permissions_api.rb
faalis-2.0.1 lib/faalis/api/permissions_api.rb
faalis-2.0.0 lib/faalis/api/permissions_api.rb
faalis-2.0.0.rc6 lib/faalis/api/permissions_api.rb
faalis-2.0.0.rc5 lib/faalis/api/permissions_api.rb
faalis-2.0.0.rc4 lib/faalis/api/permissions_api.rb
faalis-2.0.0.rc3 lib/faalis/api/permissions_api.rb
faalis-2.0.0.rc2 lib/faalis/api/permissions_api.rb
faalis-1.0.0 lib/faalis/api/permissions_api.rb
faalis-1.0.0.alpha4 lib/faalis/api/permissions_api.rb
faalis-1.0.0.alpha3 lib/faalis/api/permissions_api.rb