Closed elysiopires closed 7 years ago
@elysiopires Hope this helps
//get user id like this
$user_id = collect($request->session('sentry')->get(config('acl_sentry.cookie.key')))->first();
//then run query to get the user's group permission and permissions given to it outside the group
$what_you_need = DB::table('users_groups')->where('user_id', $user_id)
->leftJoin('groups', 'users_groups.group_id', '=', 'groups.id')
->leftJoin('users', 'users.id', '=', 'users_groups.user_id')
->select('groups.name', 'users_groups.user_id', 'groups.permissions', 'users.permissions')
->get();
dd($what_you_need);
Thank you! Works great! Have a nice day...
How can I get all permissions that user has including the permissions assigned to the group?
Example Group 1 has:
User1 has: -Permission 4
I want to know if there is any method that returns all permissions?
Thx, Elysio