Liferay.Loader.define("app-builder-web@1.0.76/js/hooks/usePermissions.es", ['module', 'exports', 'require', 'frontend-js-react-web$react', '../pages/entry/PermissionsContext.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = usePermissions;

    var _react = require("frontend-js-react-web$react");

    var _PermissionsContext = require("../pages/entry/PermissionsContext.es");

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    function usePermissions() {
      var actionIds = (0, _react.useContext)(_PermissionsContext.PermissionsContext);
      return {
        add: actionIds.includes(_PermissionsContext.ACTIONS.ADD_DATA_RECORD),
        delete: actionIds.includes(_PermissionsContext.ACTIONS.DELETE_DATA_RECORD),
        update: actionIds.includes(_PermissionsContext.ACTIONS.UPDATE_DATA_RECORD),
        view: actionIds.includes(_PermissionsContext.ACTIONS.VIEW_DATA_RECORD)
      };
    }
    //# sourceMappingURL=usePermissions.es.js.map
  }
});
//# sourceMappingURL=usePermissions.es.js.map