Commit 5efbec0c authored by Nicolas Widart's avatar Nicolas Widart

Implement the hasRole method for sentry

parent ae74cc2f
<?php namespace Modules\User\Entities\Sentry;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
use Cartalyst\Sentry\Users\Eloquent\User as SentryModel;
use Laracasts\Presenter\PresentableTrait;
use Modules\User\Entities\UserInterface;
......@@ -30,5 +31,8 @@ class User extends SentryModel implements UserInterface
*/
public function hasRole($roleId)
{
$role = Sentry::findGroupById($roleId);
return $this->inGroup($role);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment