drush role-listfor drush 8x


Display a list of all roles defined on the system. If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.

drush role-list

  • Aliases


    role-list has 1 alias/es:


    drush rls

  • Arguments


    role-list accepts 1 argument/s:


    role : The role to list.  Optional; if specified, lists all permissions assigned to that role.  If no role is specified, lists all of the roles available on the system.

  • Options


    role-list accepts 18 option/s:


    --filter : Limits the list of roles to only those that have been assigned the specified permission. Optional; may not be specified if a role argument is provided.

    --format : Select output format. Available: json, csv, html, list, table, var_export, yaml. Default is json.

    --fields : Fields to output.

    --list-separator : Specify how elements in a list should be separated. In lists of lists, this applies to the elements in the inner lists.

    --line-separator : In nested lists of lists, specify how the outer lists ("lines") should be separated.

    --field-labels : Add field labels before first line of data. Default is on; use --no-field-labels to disable.

    --format=json : Javascript Object Notation.

    --format=config : A configuration file in executable php format. The variable name is "config", and the variable keys are taken from the output data array's keys.

    --format=csv : A list of values, one per row, each of which is a comma-separated list of values.

    --format=html : An HTML representation

    --format=labeled-export : A list of php exports, labeled with a name.

    --format=list : A simple list of values.

    --format=php : A serialized php string.

    --format=print-r : Output via php print_r function.

    --format=table : A formatted, word-wrapped table.

    --format=var_export : An array in executable php format.

    --format=variables : A list of php variable assignments.

    --format=yaml : Yaml output format.

  • Examples


    Display a list of roles that have the administer nodes permission assigned.

    drush role-list --filter='administer nodes'

    Display all of the permissions assigned to the anon user role.

    drush role-list 'anonymous user'

  • Comments


    comments powered by Disqus