Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Greg Dillier
Role based page access
November 15, 2011 5:03 AM
Answer

Greg Dillier

Rank: Junior Member

Posts: 34

Join Date: November 1, 2010

Recent Posts

Hello all

I have the following problem with role based page permissions:

There are three roles:
- customer
- employee
- partner

Users have pages in this order:
- welcome (viewing permission set to customer, employee and partner)
- homeC (viewing permission set to customer)
- homeE (viewing permission set to employee)
- homeP (viewing permission set to partner)

When a user with customer role see a users page he will see welcome and homeC.
When a user with employee role see a users page he will see welcome and homeE.
When a user with partner role see a users page he will see welcome and homeP.

So far, this works as supposed.

Now, when I delete the welcome pages, or when I move the welcome page to the right (after partner) the pages are no more accessible.

How can this be solved?

Regards,
Greg
Ravi Kumar Gupta
RE: Role based page access
November 15, 2011 5:30 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1247

Join Date: June 23, 2009

Recent Posts

Just check once.. if you login with customer user then can you see the homeC and welcome??
Greg Dillier
RE: Role based page access
November 15, 2011 6:31 AM
Answer

Greg Dillier

Rank: Junior Member

Posts: 34

Join Date: November 1, 2010

Recent Posts

Ravi Kumar Gupta:
Just check once.. if you login with customer user then can you see the homeC and welcome??



Basically yes, but there seems to be a problem with the links.
I did a portlet with hardcoded links like this:

www.domain.com/web/username/

Those links still don't work.

There is no problem with the full hardcoded links though:

www.domain.com/web/username/home
www.domain.com/web/username/home1
www.domain.com/web/username/home2
Ravi Kumar Gupta
RE: Role based page access
November 15, 2011 10:11 PM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1247

Join Date: June 23, 2009

Recent Posts

The question I asked because the first page is generally the home of the site.. and is generally everyone can view.. so when a partner logs in, and homeC which is for customer only, partner will not be able to see that.. Try to make the first page as open for all customers, partners and employees..

If you want to show content according to their roles then place portlets and give appropriate permissions..
If I am getting your problem right.. this should help.. emoticon
Sandeep Nair
RE: Role based page access
November 15, 2011 10:46 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1693

Join Date: November 5, 2008

Recent Posts

Yes Ravi is right. But coming back to your question, if you need solution for your problem, you can create a service pre hook and redirect user to the first available viewable layout if the request is for http://domainName/userName

Regards,
Sandeep
Greg Dillier
RE: Role based page access
November 16, 2011 1:52 AM
Answer

Greg Dillier

Rank: Junior Member

Posts: 34

Join Date: November 1, 2010

Recent Posts

Thank you both, you describe exactly the problem I'm experiencing.
Adding a page to the left that is available for all relevant users helps.

What do you think of having a dynamic navigation tool that shows only full links to those pages, for which the user has viewing permissions? Will this solve the problem too or will there be another restriction?

Regards,
Greg
Ravi Kumar Gupta
RE: Role based page access
November 16, 2011 3:29 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1247

Join Date: June 23, 2009

Recent Posts

Check the navigation.vm from the theme. It does exactly what you are mentioning. Only pages with view permission to that role appear in the navigation..
Zeeshan Khan
RE: Role based page access
November 23, 2011 3:55 AM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Greg Dillier:
Hello all

I have the following problem with role based page permissions:

There are three roles:
- customer
- employee
- partner

Users have pages in this order:
- welcome (viewing permission set to customer, employee and partner)
- homeC (viewing permission set to customer)
- homeE (viewing permission set to employee)
- homeP (viewing permission set to partner)

When a user with customer role see a users page he will see welcome and homeC.
When a user with employee role see a users page he will see welcome and homeE.
When a user with partner role see a users page he will see welcome and homeP.

So far, this works as supposed.

Now, when I delete the welcome pages, or when I move the welcome page to the right (after partner) the pages are no more accessible.

How can this be solved?

Regards,
Greg



Hi Greg !!

i too have same kinda requirement i.e. role based themes....means different themes for different users....how did u do that....i need ur help in this....

thnx !!
Greg Dillier
RE: Role based page access
December 15, 2011 2:36 AM
Answer

Greg Dillier

Rank: Junior Member

Posts: 34

Join Date: November 1, 2010

Recent Posts

Hi Greg !!

i too have same kinda requirement i.e. role based themes....means different themes for different users....how did u do that....i need ur help in this....

thnx !!


I did different pages with their own themes for the roles. May not be the best solution though..

Regards,
Greg
Zeeshan Khan
RE: Role based page access
December 15, 2011 10:30 PM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Hi Greg !!

thnx ........so this means i have to put different themes for different roles.....???