Try ERPNext Buy Support Partners Foundation

User restriction based on company

Hi guys,

Basically what I’m trying to do is, restrict users to see the transactions only related to the company they are linked to. I’m able to achieve most of it, but I’ve stuck with one issue.

Say that I have two companies A and B and two user testuser1 and testuser2. I’ve added user permissions for both the users i.e testuser1 has permission to only company A and testuser2 has got permission to company B as shown in the image below-

So the assumption here is that when you login as testuser1 he should not see the company B. This does happen as expected as shown in the image below-

Restrictions are also proper -
image

But when I take the url of the company B and try to access it from testuser1, I’m able to see the company B as shown in the image below-

I assume it’ll behave the same way all over the system, So coming to the question here-
Is this the normal behaviour?
Is there something I am doing wrong ?
If I’m wrong Is there another way to restrict user based on the permission I set him?

@Paul_Clinton, did you figure this out ? I am also new here and this is what i am working on now.

Nope, I guess it must be a bug from frappe side(Or it must be intended). Not sure. Haven’t got any clarification yet.

Hi Paul,

I think some validation when you access from the url is missing. But while that’s something that needs to be fixed, ignore that for the moment and try and see if one of the users can make a transaction (like Quotation, Sales Order, Stock Entry, Purchase Receipt, etc. etc.) for a company is not authorized to access.

Hope this helps.

Thanks

Jay

Hi

Carrying out some testing on above.

Yes.
When entering or inquiring transactions, the restricted company will not show. The URL will only allow navigating to the company screen. Though you can update the Company Data and save.

Thanks.

Rgds
Fahad

@Paul_Clinton Can you confirm if the user (you are trying to apply User Permission for) does not have System Manager role?