Class: TentD::API::Followers::GetMany

Inherits:
Middleware
  • Object
show all
Defined in:
lib/tentd/api/followers.rb

Instance Method Summary collapse

Methods inherited from Middleware

#call, #initialize

Methods included from Authorizable

#authorize_env!, #authorize_env?

Constructor Details

This class inherits a constructor from TentD::API::Middleware

Instance Method Details

#action(env) ⇒ Object



131
132
133
134
135
136
137
138
139
# File 'lib/tentd/api/followers.rb', line 131

def action(env)
  if env.full_read_authorized
    followers = Model::Follower.fetch_all(env.params)
  else
    followers = Model::Follower.fetch_with_permissions(env.params, env.current_auth)
  end
  env.response = followers if followers
  env
end