I want to create dynamic permissions for each users through checkbox using Sentry in Laravel 4.
I've created a table named permissions
that has two columns:
id | name | user_id
Now, I want to use:
Sentry::hasAccess('any_permission_name')
But this 'any_permission_name'
should come from permissions
table.
I've extend the SentrUserModel
in my User
model and add this relation to the User model:
public function permission(){
return $this->hasMany('Permission');
}
Now, I don't understand how to use Sentry with different permissions
table for fetching the permissions.
Is there any way to use Sentry for this?