1 2 3 4 5 6 7 8 9 10 11 12 13 |
$User = App\Components\User\Models\User::find($id); // using permission ID $permissionID = 1 // the permission ID that you add/define on permissions $permissionValue = 1 // values can be (1,0,-1) allow=1, inherit=0, deny=-1 $User->addPermission($permissionID,$permissionValue); // using permission object $permission = App\Components\User\Models\Permission::find($id); // the permission object $permissionValue = 1 // values can be (1,0,-1) allow=1, inherit=0, deny=-1 $User->addPermission($permission,$permissionValue); |