filter_get_roles_by_format

7 filter.module filter_get_roles_by_format($format)
8 filter.module filter_get_roles_by_format($format)

Retrieves a list of roles that are allowed to use a given text format.

Parameters

$format: An object representing the text format.

Return value

An array of role names, keyed by role ID.

4 calls to filter_get_roles_by_format()

File

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

Code

function filter_get_roles_by_format($format) {
  // Handle the fallback format upfront (all roles have access to this format).
  if ($format->format == filter_fallback_format()) {
    return user_roles();
  }
  // Do not list any roles if the permission does not exist.
  $permission = filter_permission_name($format);
  return !empty($permission) ? user_roles(FALSE, $permission) : array();
}
Login or register to post comments