CRM_Core_Permission is a PHP function that is used in the CiviCRM platform. It is a library that provides permission checking functionality.
The function is used to determine whether a particular user has permission to perform an action in CiviCRM. This can include things like viewing or editing contacts, creating or modifying events, or creating new donors.
Here are a few examples of how to use CRM_Core_Permission getPermission:
Example 1: Check if the user has permission to view a contact's details
if (CRM_Core_Permission::check('access contact summary')) { // code to display contact's details here }
In this example, the 'access contact summary' permission is checked to ensure that the user has permission to view the contact's details.
Example 2: Check if the user has permission to modify an event
if (CRM_Core_Permission::check('edit event')) { // code to allow user to modify event details here }
In this example, the 'edit event' permission is checked to ensure that the user has permission to modify the event details.
Example 3: Check if the user has permission to create new donors
if (CRM_Core_Permission::check('create contributions')) { // code to allow user to create new donors here }
In this example, the 'create contributions' permission is checked to ensure that the user has permission to create new donors.
Overall, CRM_Core_Permission is a useful library for developers who want to add permission checking functionality to their CiviCRM applications. It is part of the CiviCRM package library.
PHP CRM_Core_Permission::getPermission - 30 examples found. These are the top rated real world PHP examples of CRM_Core_Permission::getPermission extracted from open source projects. You can rate examples to help us improve the quality of examples.