YassineEdouiri
YassineEdouiri

Reputation: 65

Get all the permissions in (/admin/people/permissions)

is there any drupal 7 function can list all the permissions in the system (/admin/people/permissions) like this ( user_permission_get_modules() )

i'm trying to create a drupal module ,what i need is to get all the permissions and add each one of the list in a checked box list and please if there is any possibility to make the value of the checked box the same as the column 'permission' in the table 'role_permission'.

thanks in advance ^_^

Upvotes: 0

Views: 333

Answers (1)

tvanc
tvanc

Reputation: 4314

The easiest thing to do would be to just reuse the built-in permissions form.

$form = drupal_get_form('user_admin_permissions');

If you need to alter the form for your purposes, you can do so after retrieving it with the code above. I recommend using the dpm function from the devel module to analyze the form and see what changes you need to make to it.

Upvotes: 1

Related Questions