entrust icon indicating copy to clipboard operation
entrust copied to clipboard

Multiple Roles but different Companies

Open cesuarez opened this issue 7 years ago • 7 comments

Hi, is it posible to use Entrust to give a Role to a user, but, for example, to different Companies?

I want to have Roles based on another Model object, not just Universal Roles for the User

Thanks in advance!

cesuarez avatar Apr 07 '17 18:04 cesuarez

I think i understand what you mean, you mean you want to group users into companies, and each company has it's own permissions? If you don't need user permissions, i mean you will need ONLY companies permission, i think it will be possible, otherwise, i'm not sure it will work :/

monaam avatar Apr 10 '17 15:04 monaam

Something like that, but I want Roles per company.

I guess I can add company-specific permissions, but thats not a nice aproach for me

cesuarez avatar Apr 12 '17 16:04 cesuarez

@cesuarez Just curious if you ever got this working. I have a similar situation where I have users that are assigned a role in a company. And each company has their own role-specific permissions.

Xinil avatar Jun 14 '17 21:06 Xinil

@cesuarez Have you made any progress with this? I need this feature for my current project. I have organizations using my system and users can belong to two different organizations. So in the role_user table, I want to create another column for organization id so that a user belonging to two different organizations can have different roles. @Xinil

seongbae avatar Mar 30 '18 20:03 seongbae

Hello. There is any soltution ? Thanks

cpndaj avatar Feb 20 '19 13:02 cpndaj

Just wanted to follow up. I had to modify the source code to get this working. There is no solution without manipulating the hasRole() and hasPermission() methods.

Xinil avatar Feb 20 '19 17:02 Xinil

Hi Xinil, could you help me, please ? Thanks a lot !!!

cpndaj avatar Feb 20 '19 17:02 cpndaj