text: // Generated by LiveScript 1.2.0
  (function(){
    var Ability, fingerprints, CachedAbility, slice$ = [].slice;
    Ability = require('../ability');
    fingerprints = require('../access_request/fingerprints');
    module.exports = CachedAbility = (function(superclass){
      var prototype = extend$((import$(CachedAbility, superclass).displayName = 'CachedAbility', CachedAbility), superclass).prototype, constructor = CachedAbility;
      function CachedAbility(user){
        this.user = user;
        CachedAbility.superclass.apply(this, arguments);
        this.userKey();
      }
      CachedAbility.clearCache = function(){
        constructor.canCache = {};
        return constructor.cannotCache = {};
      };
      CachedAbility.canCache = function(){
        return this._canCache || (this._canCache = {});
      };
      CachedAbility.cannotCache = function(){
        return this._cannotCache || (this._cannotCache = {});
      };
      prototype.userHash = fingerprints.userHash;
      prototype.userKey = function(){
        return this.userKey = this.userHash();
      };
      prototype.authorize = function(act){
        var args;
        this.act = act;
        args = slice$.call(arguments, 1);
        this.clear();
        if (this.hasCachedResult()) {
          return this.cachedResult();
        } else {
          this.cacheResult();
        }
        this.debug('cannot-res', this.authResult());
        return this.authResult();
      };
      prototype.accReqKey = function(){
        return this.accessRequest().accessHash();
      };
      prototype.hasCachedResult = function(){
        return this.cachedResult() !== void 8;
      };
      prototype.clear = function(){
        superclass.prototype.clear.call(this);
        return this._lastResult = void 8;
      };
      prototype.cachedResult = function(){
        return this._lastResult || (this._lastResult = this.cache()[this.accReqKey()]);
      };
      prototype.cacheResult = function(){
        return this.cache()[this.accReqKey()] = this.authResult();
      };
      prototype.cache = function(){
        return this[this.act + "Cache"]();
      };
      prototype.canCache = function(){
        return constructor.canCache()[this.userKey] || {};
      };
      prototype.cannotCache = function(){
        return constructor.cannotCache()[this.userKey] || {};
      };
      return CachedAbility;
    }(Ability));
    function extend$(sub, sup){
      function fun(){} fun.prototype = (sub.superclass = sup).prototype;
      (sub.prototype = new fun).constructor = sub;
      if (typeof sup.extended == 'function') sup.extended(sub);
      return sub;
    }
    function import$(obj, src){
      var own = {}.hasOwnProperty;
      for (var key in src) if (own.call(src, key)) obj[key] = src[key];
      return obj;
    }
  }).call(this);
  