Mixin: WithAuthorization
Defined in: | src/mixin/withAuthorization.coffee |
Overview
Allows classes to request authorization to perform actions. Requires the {Observable Observable} mixin.
Method Summary
- ? (void) withAuthorization(params) Require authorization for a given action.
Method Details
? (void) withAuthorization(params)
Require authorization for a given action.
Notifies observers to the requiresAuthorization
event, passing an action callback which the observer can
either call (if authorized), store, or ignore, and a deferred,
which completion of the callback will resolve.
The deferred may be rejected by the handling observer;
its promise is the return value of {#withAuthorization}.
Examples:
@withAuthorization: action: => @save()