45
Views
10
Comments
Restriction of contractors to view other contractors material
Question

Hi, 
I have a question regarding showing material listing. I have multiple contractors in my system with all their materials listing. For example Contractor A, Contractor B, Contractor C and so on . So right now i would like to restrict all the contractors from looking to each other materials. So that each contractor can only view their specific material listing. 

Please help me on this

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Hi Jaydav Vasudevan ,

follow these steps

1. put the user id into material entity. and set the user id for individual's material while saving the material details.

2. while listing the materials add the filter for material.userid=Getuserid() into the aggregate for listing. by this each of the contractor would be to see the own material only. if it doesnt help please try to attach the oml or screenshots so would be able to help more.

Hope this will help

Thanks

Prince

UserImage.jpg
Jaydav Vasudevan

Hi, Prince
Currently i have Contractor entity, material listing entity. Material listing is currently tied to contractor id

The filter i should add it at the material listing aggregate in the materials screen right

UserImage.jpg
Jaydav Vasudevan

So, this is my screen of materials page

So i must add my filter in the aggregate. So i believe my filter should be materiallisiting.contractorid=Getuserid() 

This is what i get when i fill it in.

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

You are comparing a "ContractIdentifier" with "UserIdentifier".


GetUserId() is a function that returns the identifier of the user. Not the contractid.

Is Contractors are users who is logging into the application?


Regards,

Wasimkhan S

2024-05-08 06-29-37
Prince Aadil Khan Panwar

convert the contractor id to User identifier in the entity. i hope this will work.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Jaydav Vasudevan ,

what exactly your filter should be, depends on how you make a link between a logged in user, and a contractor.  

We don't know that, can you tell us and/or show your datamodel ?

Dorine

2019-09-30 07-35-56
Aurelio Junior

Hello,

It sounds like you could benefit from OutSystems' multi-tenancy capabilities. In your case, each contractor would be a tenant, with its own isolated data.

Here's some documentation explaining how this works in OutSystems.

UserImage.jpg
Jaydav Vasudevan

Hi Aurelio 
I will look into it ya thanks

UserImage.jpg
vikas sharma
Champion

Hi,

If its only matter of contractor listing and their different material list then don't think should go for multitenancy. Solution suggested by Prince will work. Store materials data with contractor id. 

regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.