You are here

function filter_permission_name in Drupal 7

Returns the machine-readable permission name for a provided text format.

Parameters

$format: An object representing a text format.

Return value

The machine-readable permission name, or FALSE if the provided text format is malformed or is the fallback format (which is available to all users).

15 calls to filter_permission_name()
BlockTestCase::setUp in modules/block/block.test
Sets up a Drupal site for running functional and integration tests.
FilterAdminTestCase::setUp in modules/filter/filter.test
Sets up a Drupal site for running functional and integration tests.
FilterDefaultFormatTestCase::testDefaultTextFormats in modules/filter/filter.test
Tests if the default text format is accessible to users.
FilterFormatAccessTestCase::setUp in modules/filter/filter.test
Sets up a Drupal site for running functional and integration tests.
FilterFormatAccessTestCase::testFormatPermissions in modules/filter/filter.test
Tests the Filter format access permissions functionality.

... See full list

File

modules/filter/filter.module, line 380
Framework for handling the filtering of content.

Code

function filter_permission_name($format) {
  if (isset($format->format) && $format->format != filter_fallback_format()) {
    return 'use text format ' . $format->format;
  }
  return FALSE;
}