Class: TentD::API::Followers::GetOne
- Inherits:
-
Middleware
- Object
- Middleware
- TentD::API::Followers::GetOne
- Defined in:
- lib/tentd/api/followers.rb
Instance Method Summary collapse
Methods inherited from Middleware
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
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/tentd/api/followers.rb', line 106 def action(env) if env. || (env, :self) follower = Model::Follower.find(env.params.follower_id) else follower = Model::Follower.(env.params.follower_id, env.current_auth) end if env. || (env, :self) || (follower && follower.public?) env.response = follower else raise Unauthorized end env end |