2

$this->crud->addClause works perfectly for listing but not when adding content to the system. What's the correct way to add that functionality to the field types?

Imagine that there are many users, each user has multiple projects and each project has multiple tickets.

When a user creating a ticket for a project, he/she shouldn't be able to see the projects belong to other users. So how to filter relationship results by the session or related data?

Tim
  • 699
  • 8
  • 27

1 Answers1

0

I'm facing a situation just like that and I think Backpack\PermissionManager will do it.

You can check for the right permissions and apply the necessary filters. Like this:

if ($user->can('see projects from others')) {
    // do something
}
Claudson Martins
  • 348
  • 1
  • 3
  • 14