mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-05 15:47:25 +02:00
Implement method 'getRoles' in class 'Auth'
This commit is contained in:
13
src/Auth.php
13
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
|
||||
*
|
||||
|
Reference in New Issue
Block a user