Developer forum

Forum » CMS - Standard features » Restriction of login functionality to specific groups

Restriction of login functionality to specific groups

Nicolai Jessen
Nicolai Jessen
Reply

Hi,

Is it possible to restrict login functionality to specific groups in Dynamicweb? (9.14.4)
I would like to have a setup where users from the US site cannot login to the EU site and similarly, the users from the EU site cannot login to the US site. They should however still be able to visit the site and look at the content which i can't seem to achieve with the current page/site restrictions - It is only the login i would like to restrict specific user groups for each site.

I would appreciate it if someone could provide some guidance or best practices on how to achieve this setup and if it is possible to achieve through what comes out of the box in DW. Thank you in advance for your help!

Best regards, Nicolai


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

You set permissions based on User Groups. So to achieve this, you need to set permissions, not for the system roles, but rather for specific user groups.

 

This means that you need to have a US and a EU user group separately. Depending on your requirements you can have those user groups be populated through smart searches.

 

The concept is no different than if you needed to have 2 areas within the same website with different permissions (i.e. 'Regular logged in users' vs 'Purchasers' vs 'Tech support' ...)

 

Hope this gets you unblocked.

Nuno Aguiar

 
Nicolai Jessen
Nicolai Jessen
Reply

Hi Nuno,

I understand. But how do i make the restriction for the US group stopping them from being able to log in to the frontend of the EU site?
Is there a way to make the restriction on the extranet app that handles login/or the login in general for the whole solution?

(I forgot to mention that i'm running Rapido (3.4.2) on my solution)

Thanks!
Nicolai 

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

If you want to technically prevent them from logging in, then you need to use a Notification subscriber. You can look into this and implement your customization for it.

https://doc.dynamicweb.com/apix/api/Dynamicweb.Examples.Notifications.Standard.OnExtranetLogOnObserver.html

 

There might be other notifications that better fit your needs, so I recommend exploring what's available within Notifications.Standard.*

 

BR,

Nuno Aguiar

 
Nicolai Jessen
Nicolai Jessen
Reply

Hi Nuno,

Thanks for the answer. I did think of using the Notification subscriber, just wanted to hear if there was a smart way of doing this in the DW-backend instead. Would be a usefull feature! :-)

BR,

Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply
This post has been marked as an answer

Hi Nicolai,

If you have sepoarate shops, you can use that parameter to separate the users.

The User object has a ShopId property that is taken into consideration when logging in.

Without separate shops, Nuno's solution is probably the only one.

Adrian

Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Nice callout Adrian. I hadn't remembered about the separate shops.

 

Nicolai, here's some documentation on that

BR,

Nuno Aguiar

 

You must be logged in to post in the forum