diff --git a/src/Auth.php b/src/Auth.php index 0ff2e59..cdb1d9a 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -1500,6 +1500,19 @@ final class Auth extends UserManager { return true; } + /** + * Returns an array of the user's roles, mapping the numerical values to their descriptive names + * + * @return array + */ + public function getRoles() { + return \array_filter( + Role::getMap(), + [ $this, 'hasRole' ], + \ARRAY_FILTER_USE_KEY + ); + } + /** * Returns whether the currently signed-in user has been remembered by a long-lived cookie *