Class: Apill::Authorizers::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/apill/authorizers/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, user:, resource:, **other) ⇒ Query

Returns a new instance of Query.



8
9
10
11
12
13
14
15
16
# File 'lib/apill/authorizers/query.rb', line 8

def initialize(token:, user:, resource:, **other)
  self.token    = token
  self.user     = user
  self.resource = resource

  other.each do |name, value|
    public_send("#{name}=", value)
  end
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



4
5
6
# File 'lib/apill/authorizers/query.rb', line 4

def resource
  @resource
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/apill/authorizers/query.rb', line 4

def token
  @token
end

#userObject

Returns the value of attribute user.



4
5
6
# File 'lib/apill/authorizers/query.rb', line 4

def user
  @user
end

Instance Method Details

#able_to_create?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/apill/authorizers/query.rb', line 26

def able_to_create?
  false
end

#able_to_destroy?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/apill/authorizers/query.rb', line 34

def able_to_destroy?
  false
end

#able_to_index?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/apill/authorizers/query.rb', line 18

def able_to_index?
  true
end

#able_to_show?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/apill/authorizers/query.rb', line 22

def able_to_show?
  false
end

#able_to_update?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/apill/authorizers/query.rb', line 30

def able_to_update?
  false
end