I have the Developer user role which should only access the developer_html input format. I am trying to grant the necessary permission with user_role_grant_permissions().
I got this piece of code here and also tried to edit according to my requirement, but failed.
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);
}
}
}