mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 14:17:26 +02:00
Add tests for read access to user's roles via 'Auth' interface
This commit is contained in:
@@ -325,6 +325,19 @@ function showDebugData(\Delight\Auth\Auth $auth, $result) {
|
|||||||
echo ' / ';
|
echo ' / ';
|
||||||
var_dump($auth->getStatus());
|
var_dump($auth->getStatus());
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
|
echo 'Roles (super moderator)'."\t\t\t";
|
||||||
|
var_dump($auth->hasRole(\Delight\Auth\Role::SUPER_MODERATOR));
|
||||||
|
|
||||||
|
echo 'Roles (developer *or* manager)'."\t\t";
|
||||||
|
var_dump($auth->hasAnyRole(\Delight\Auth\Role::DEVELOPER, \Delight\Auth\Role::MANAGER));
|
||||||
|
|
||||||
|
echo 'Roles (developer *and* manager)'."\t\t";
|
||||||
|
var_dump($auth->hasAllRoles(\Delight\Auth\Role::DEVELOPER, \Delight\Auth\Role::MANAGER));
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
echo '$auth->isRemembered()'."\t\t\t";
|
echo '$auth->isRemembered()'."\t\t\t";
|
||||||
var_dump($auth->isRemembered());
|
var_dump($auth->isRemembered());
|
||||||
echo '$auth->getIpAddress()'."\t\t\t";
|
echo '$auth->getIpAddress()'."\t\t\t";
|
||||||
|
Reference in New Issue
Block a user