Support the ongoing development of Laravel.io →
Security Architecture

Hi,

description of my problem:

I have departments,projects and tasks. Users are invited/assigned to departments,projects and tasks. And I have two options a) user can see ALL content in group and projects to which he is assigned and b) user can see only content in that specific group to which he is assigned (other content is not visible to user)

So when I create new user I have those to options. In 'users' table I have column "visibility" with values '0' and '1' .

All my models are using eloquent:

User model: http://laravel.io/bin/dJ7P

Task model: http://laravel.io/bin/KRX8

Project model: http://laravel.io/bin/xkm4

So in basic, If I select "user can see only assigned projects and tasks", they can see only those specific projects AND those specific tasks in that project and nothing else. I load projects (which have tasks) in basecontroller with

if (Sentry::check()) {
    $user = Sentry::getUser();
  $projects = User::find($user->id)->projects;
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

RokSiEu roksieu Joined 31 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.