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-0.18.0 lib/faalis/api/permissions_api.rb
faalis-0.17.0 lib/faalis/api/permissions_api.rb
faalis-0.16.3 lib/faalis/api/permissions_api.rb
faalis-0.16.1 lib/faalis/api/permissions_api.rb
faalis-0.16.0 lib/faalis/api/permissions_api.rb
faalis-0.15.1 lib/faalis/api/permissions_api.rb
faalis-0.15.0 lib/faalis/api/permissions_api.rb
faalis-0.14.4 lib/faalis/api/permissions_api.rb
faalis-0.14.3 lib/faalis/api/permissions_api.rb
faalis-0.14.2 lib/faalis/api/permissions_api.rb
faalis-0.14.0 lib/faalis/api/permissions_api.rb
faalis-0.11.1 lib/faalis/api/permissions_api.rb
faalis-0.11.0 lib/faalis/api/permissions_api.rb
faalis-0.7.0 lib/faalis/api/permissions_api.rb