
META-INF.resources.page_editor.app.actions.togglePermission.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.layout.content.page.editor.web
Show all versions of com.liferay.layout.content.page.editor.web
Liferay Layout Content Page Editor Web
The newest version!
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
import {TOGGLE_PERMISSION} from './types';
export type PermissionKey =
| 'EDIT_SEGMENTS_ENTRY'
| 'INSTALL_FREE_BUNDLED_APPS_MARKETPLACE'
| 'LOCKED_SEGMENTS_EXPERIMENT'
| 'MANAGE_FRAGMENT_ENTRIES'
| 'PURCHASE_AND_INSTALL_PAID_APPS_MARKETPLACE'
| 'SWITCH_EDIT_MODE'
| 'UPDATE'
| 'UPDATE_LAYOUT_ADVANCED_OPTIONS'
| 'UPDATE_LAYOUT_BASIC'
| 'UPDATE_LAYOUT_CONTENT'
| 'UPDATE_LAYOUT_LIMITED'
| 'VIEW_MARKETPLACE';
export default function togglePermission(
key: PermissionKey,
value: boolean | undefined = undefined
) {
const action: {
forceNewValue?: boolean;
key: PermissionKey;
type: typeof TOGGLE_PERMISSION;
} = {
key,
type: TOGGLE_PERMISSION,
};
if (typeof value === 'boolean') {
action.forceNewValue = value;
}
return action;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy