Support the ongoing development of Laravel.io →
Authentication Security Eloquent
Last updated 2 years ago.
0

Well, simple solution I can think of right away is author_id column. With author(s) set you just need to do a check, it can be "author" filter. It depends on your preferences and action you are performing, where to place the author condition.

Last updated 2 years ago.
0

Hi Belar,

Thanks for that, yes I have a user_id set on each item, was just looking for a pointer as to the best way to list and restrict editing to the owner.

As I said I am new to Laravel so unsure of the best way to do this.

If someoen couuld point me to some code or a tutorial I would be greatful.

Last updated 2 years ago.
0

Hi vool,

I am interested in a very same thing, I am sure there is a lot of ways how this could be done, so it would be great to know what is considered as a best practice around this topic. Is 'row level permissions' a term which is used to describe what we are looking for?

Last updated 2 years ago.
0

I just compare the user_id of a record with the user id inside the session. You could write a function for you controllers or a filter.

Should be an easy and good way.

Last updated 2 years ago.
0

...looks like when I was replying in this thread, Philip Brown was busy writing his next blog post:

http://culttt.com/2014/03/31/multi-tenancy-laravel-4/

and I think it is something that we were looking for - although for me at the moment it is still quite difficult to understand all aspects, I will need to read it couple of times I guess :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

vool vool Joined 3 Mar 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.

© 2024 Laravel.io - All rights reserved.