Jump to content

[SOLVED] How to implement group restriction in module


patrikar
 Share

Recommended Posts

Hello everyone,

 

I have a module that shows information in the site's right column intended only for a particular group of customers.

 

In group settings I've set every other group as Unauthorized to my module but that didn't change anything. I googled and found some user in the same situation stating that the module didn't support group restriction.

 

So how do I implement group restriction in my module?

 

Is there a predefined way like using $this->context->customer->isLogged()?

Edited by patrikar (see edit history)

Share this post


Link to post
Share on other sites

Turns out I were logged on as a user in the group which should access - so there's no need to implement anything for group restriction to work. Solved.

 

I managed to do some research before I figured that out so thought I would share that. For finding out which group a user belongs to one can look at $this->context->customer->id_default_group and for simpler means $this->context->customer->is_guest.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More