Drupal 9 : Contextual Filter Based Upon Current User and commerce Product with Company - view

I have created a Taxonomy of Organizations. I have then added a custom required field to my User accounts call "Organization". Also I have added the custom "Organization" field in commerce Product.
I have created view, when user login they should view the Product which is common to all as well as product belong to his/her organisation.
For Example:
Consider Product A , B & C
Product A belong to X organisation.
Product B & C common to all the users
User1 - X organisation
User2 - Y organisation
When User1 logs in he should see, Product A, B & C
User2 should see only B & C
how to achieve this using views contextual filter
Regards
Girija S

Related

ERD of three level user hierarchy ( superadmin -> admin -> staff )

I am developing an e-commerce portal, using django rest framework, facilitating multiple vendors to upload their products.
Case:
To upload product, the vendor need to register through the portal. But now they need to register three of their employees as a staff, who will be uploading the product on the behalf of the brand/company. Also the product previously listed on the portal must be visible to them on their dashboard so that they can edit attributes whenever required.
Problem :
I had just thought of two level user hierarchy ( me as admin and vendor as staff).
I had not thought of this three level hierarchy ( me as superadmin, vendor as admin and employees as staff ). How to establish these relations.
Existing tables as of now:
a) User (name, username, password)
b) Vendor ( documents , GST details )
c) Product ( name, brand, price)
Now I am thinking to include a new table ( Organization) which will include ID, name, brand name )
Is this approach good enough to proceed?
If anyone has worked in similar cases, kindly help.

Show only user specific team activities

Lets say
User A belongs to Team X and Team Y
User B belong to Team X
User C belongs to Team X
I want to create a view to display only activities owned by users belonging to Team X and not belonging to both Team X&Y. That result set should only display activities belonging to User B&C.
I created a view but it shows activities of user A as well.
Advance Find
I think you probably want one of these 'equals current user...' options.
Or perhaps simply this - you can enter multiple users.
You also have to keep in mind Security roles and how they impact your views. If you are a SysAdmin, your views will not be filtered at all by ownership - only the criteria you put into the view. If you have a view where "Owner = Team A", then SysAdmin would see all those records where Owner = Team A. If you have a less-permissed user (say, they only have USER LEVEL read on the entity), and the view is "Owner =Team A" - they'd only see records in that view if they belonged to Team A.
It is important to know that User ownership is a mirror of Team ownership. So, User level read actually lets me see ALL records that I own or MY TEAMS own, that satisfy your filter criteria.
Above answer should work - I would use "Equals Current User or User's Teams" but again, depends on exactly what you are trying to do and how everything is setup in CRM

Control access to Case(incident) in MSCRM 2015

We came across the scenario where we need to control the access to the Case records based on value selected in the field.
There are 2 users U1 and U2 under the Business Units B1 and B2 respectively. Both the users having Organization level full access on Contact and Account entities and Business Unit level full access on Case entity.
User U1 created a Case C1 for the Customer A1 and User U2 created a Case for the Customer A2. We got a requirement, where users U1 & U2 should be having access to C2 & C1 respectively. But, since both of them having read access to A1 & A2, they can still access the Cases C1 & C2 (which are created for the Customers A1 & A2).
So, is there any way to control the access to the Cases irrespective of the access to Customers (Account & Contact)?
It would resolve the issue if there is any workaround to control access based on the field value selected as we have Category field on Case.
Appreciate if any solution for this.
Thanks,

how to give different access authority to different users credential in magento

I have client requirement that he want to me to make different prices list of products for different users, for example there will be two types of users one normal users and other one are doctors , so he want that if normal users come to this website then the price list should be different as for doctors, like for doctor a particular product rate can be 50 Rs but the same product for normal user is 70 Rs .
so i want to know can this be possible in magento and if "yes".
How to do it??????.
You could try to accomplish this using either
Customer Group
Multi Website
Third Party extension
Take a look #
Different prices for different groups? (wholesale prices, etc.)
Magento: How to Setup Simple Customer Specific Discount Pricing

How to show only products that are allowed to logged in user in Magento?

In our current implementation of Magento, situation is as follows:
There are two types of products (items) under various categories.
1. Allowed to all
2. Allowed to specific logged in user (customer)
e.g. Let us assume that there are 100 items (under different categories) which are allowed to be shown to all logged in or not logged in users
Now there are 10 items which are allowed to be seen only by Customer A (Set A)
5 Items which are allowed to be seen only by Customer B. (Set B)
So when Customer A logs in, he/she will see all items that are allowed to all + Items from Set A but not from Set B.
When Customer B logs in, he/she will all items that are allowed to all + Items from Set B but not from Set A.
How can I achieve this result in Magento? Should I handle it in MySQL or within Magento modules?
Please suggest,
Thanks
Create Three attributes for each product.
allowedgroupA, allowedGroupB and allowedAll.
Now for products only for group B check allowedGroupB and for other two attributes done check.
Same for for products only for group A check allowedGroupA and for other two attributes done check.
products for all groups will have allowedAll as checked.
Now in your block code apply appropriate filter depending on customer logged in group.
Additional Comments:
Additionally if you have some product only for specific group or for all then just have one attributes.
allowedGroupId.
if allowedGroupId is set then its only for that specific customer group if its 0 then its for all customers.

Resources