I have a design pattern (Rails app, using RestfulAuthentication plugin
with modifications) that wants to have a method that will temporarily
elevate user privileges like so:
However I know this doesn't work because at the time the block is
passed, the binding is fixed to the defining context.
So the question is: what is the right way to achieve the desired result.
Where the desired result is to pass a block to a method to be executed
in a different context, without the caller having to know any of the
implementation details.
So the question is: what is the right way to achieve the desired result.
Where the desired result is to pass a block to a method to be executed
in a different context, without the caller having to know any of the
implementation details.
So the question is: what is the right way to achieve the desired result.
Where the desired result is to pass a block to a method to be executed
in a different context, without the caller having to know any of the
implementation details.