0

I want to create roles and permissions like the following:

Each post has many users.

  1. Type A user can do everything (create, edit, update and delete) the post.

  2. Type B user can only create, edit and update the post.

  3. Type C user can only edit and update the post.

Will this work with the santigarcor/laratrust or spatie/laravel-permission packages? Those packages look very complicated.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
wwwrrrxxx
  • 195
  • 3
  • 16
  • try laravel entrust – Emtiaz Zahid Nov 26 '18 at 07:05
  • 1
    I usually use laravel-permission by spatie. BUT seems it wont help you in this situation. If you are worry about these packages you can just use Policies (https://laravel.com/docs/5.7/authorization#creating-policies). They are well suited for your needs and do not require installation of packages. – wau Nov 26 '18 at 07:21
  • you can see here autorization gates with roles and permissions https://laravel-news.com/authorization-gates – Ismoil Shifoev Nov 26 '18 at 08:29
  • *Will this work with Laratrust or spatie/laravel-permission? Packages look very complicated.* What does that mean? Its complicated topic and spatie's package does great job abstracting it. – Kyslik Nov 26 '18 at 09:02
  • @Kyslik As they are complicated so I wanted to know if there are other ways to implement. – wwwrrrxxx Nov 26 '18 at 09:23
  • Everything you are trying to do is pretty easy with Policies, no need for a package. https://laravel.com/docs/5.7/authorization – Christophvh Nov 26 '18 at 10:51
  • @Christophvh Thanks for comment. Cool to hear that~! – wwwrrrxxx Nov 26 '18 at 11:08

1 Answers1

0

If you are looking for a basic authorization feature, laravel's default gates and policies (as mentioned in the comments) would do the trick.

If are looking for features similar to that of page roles in Facebook pages, where you have different groups each with its own posts, and users who have different permissions in different groups, then take a look at the teams feature in the laratrust package.

Sharan
  • 758
  • 8
  • 18