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-1.0.0.alpha2 lib/faalis/api/permissions_api.rb
faalis-1.0.0.alpha1 lib/faalis/api/permissions_api.rb
faalis-1.0.0.alpha0 lib/faalis/api/permissions_api.rb
faalis-0.26.3 lib/faalis/api/permissions_api.rb
faalis-0.26.2 lib/faalis/api/permissions_api.rb
faalis-0.26.1 lib/faalis/api/permissions_api.rb
faalis-0.26.0 lib/faalis/api/permissions_api.rb
faalis-0.25.1 lib/faalis/api/permissions_api.rb
faalis-0.25.0 lib/faalis/api/permissions_api.rb
faalis-0.24.4 lib/faalis/api/permissions_api.rb
faalis-0.24.3 lib/faalis/api/permissions_api.rb
faalis-0.24.2 lib/faalis/api/permissions_api.rb
faalis-0.24.0 lib/faalis/api/permissions_api.rb
faalis-0.23.0 lib/faalis/api/permissions_api.rb
faalis-0.22.0 lib/faalis/api/permissions_api.rb
faalis-0.21.1 lib/faalis/api/permissions_api.rb
faalis-0.21.0 lib/faalis/api/permissions_api.rb
faalis-0.20.0 lib/faalis/api/permissions_api.rb
faalis-0.19.0 lib/faalis/api/permissions_api.rb
faalis-0.18.1 lib/faalis/api/permissions_api.rb