iI have onethe Developer user role : developer, i want developer canwhich should only access text format :the developer_html
For this developer role needs a permission and input format. I am trying to grant thisthe necessary permission bywith user_role_grant_permissions
user_role_grant_permissions().
i searched and tried with lots of codes but failed everytime, iI got this piece of code here https://api.acquia.com/api/drupal/modules!filter!filter.install/function/filter_update_7008/7here and also tried to edit according to my requirement, but failed.
<?php
function filter_update_7008() {>
// Build the list of permissions to grant.
$permissions = array();
foreach (filter_formats() as $format_id => $format) {
if ($permission = filter_permission_name($format)) {
$permissions[] = $permission;
}
}
// Grant text format permissions to all roles that can 'administer filters'.
// Albeit anonymous users *should not* have the permission, we cannot presume
// that they do not or must not.
if ($roles = user_roles(FALSE, 'administer filters')) {
foreach ($roles as $rid => $name) {
user_role_grant_permissions($rid, $permissions);
}
}
?>}