Created
December 21, 2015 21:55
-
-
Save enygma/cc6654d8307360f16e44 to your computer and use it in GitHub Desktop.
example of a more refined Verify syntax (powered by PropAuth)
This file contains hidden or 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 | |
$user = (object)[ | |
'username' => 'ccornutt', | |
'password' => password_hash('test1234', PASSWORD_DEFAULT), | |
'permissions' => ['test1', 'test2', 'edit'] | |
]; | |
$subject = new \Psecio\Verify\Subject\Simple($user); | |
$gate = new Gateway($subject); | |
if ($gate->authorize($_POST['password']) && $gate->can('test1')) { | |
echo 'woo!'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment