UNPKG

@iredium/butterfly

Version:
46 lines (45 loc) 1.65 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var base_policy_1 = require("../../../policies/base_policy"); var Level1Policy = /** @class */ (function (_super) { __extends(Level1Policy, _super); function Level1Policy() { return _super !== null && _super.apply(this, arguments) || this; } Level1Policy.prototype.index = function () { return true; }; Level1Policy.prototype.show = function () { return true; }; Level1Policy.prototype.create = function () { return this.allowedUser(); }; Level1Policy.prototype.update = function () { return this.allowedUser(); }; Level1Policy.prototype.destroy = function () { return this.allowedUser(); }; Level1Policy.prototype.restore = function () { return this.allowedUser(); }; Level1Policy.prototype.allowedUser = function () { return this.user && this.user.admin(); }; return Level1Policy; }(base_policy_1.BasePolicy)); exports.Level1Policy = Level1Policy;