Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / user / src / PermissionHandlerInterface.php
1 <?php
2
3 namespace Drupal\user;
4
5 /**
6  * Defines an interface to list available permissions.
7  */
8 interface PermissionHandlerInterface {
9
10   /**
11    * Gets all available permissions.
12    *
13    * @return array
14    *   An array whose keys are permission names and whose corresponding values
15    *   are arrays containing the following key-value pairs:
16    *   - title: The human-readable name of the permission, to be shown on the
17    *     permission administration page. This should be wrapped in the t()
18    *     function so it can be translated.
19    *   - description: (optional) A description of what the permission does. This
20    *     should be wrapped in the t() function so it can be translated.
21    *   - restrict access: (optional) A boolean which can be set to TRUE to
22    *     indicate that site administrators should restrict access to this
23    *     permission to trusted users. This should be used for permissions that
24    *     have inherent security risks across a variety of potential use cases
25    *     (for example, the "administer filters" and "bypass node access"
26    *     permissions provided by Drupal core). When set to TRUE, a standard
27    *     warning message defined in user_admin_permissions() will be displayed
28    *     with the permission on the permission administration page. Defaults
29    *     to FALSE.
30    *   - warning: (optional) A translated warning message to display for this
31    *     permission on the permission administration page. This warning
32    *     overrides the automatic warning generated by 'restrict access' being
33    *     set to TRUE. This should rarely be used, since it is important for all
34    *     permissions to have a clear, consistent security warning that is the
35    *     same across the site. Use the 'description' key instead to provide any
36    *     information that is specific to the permission you are defining.
37    *   - provider: (optional) The provider name of the permission.
38    */
39   public function getPermissions();
40
41   /**
42    * Determines whether a module provides some permissions.
43    *
44    * @param string $module_name
45    *   The module name.
46    *
47    * @return bool
48    *   Returns TRUE if the module provides some permissions, otherwise FALSE.
49    */
50   public function moduleProvidesPermissions($module_name);
51
52 }