Last active
August 23, 2018 22:31
-
-
Save alexfinnarn/a666dcb49358b27347e59ce5170d8b8d to your computer and use it in GitHub Desktop.
getting all roles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function user_roles($members_only = FALSE, $permission = NULL, $full_objects = FALSE) { | |
$user_roles = &backdrop_static(__FUNCTION__); | |
if (!isset($user_roles)) { | |
$user_roles = array(); | |
// @todo: Consider a cache get here instead of reading from disk. | |
$names = config_get_names_with_prefix('user.role.'); | |
//....more code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment