论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
Nilesh Gundecha
Guest role permission to view all the public pages want to disable
2011年6月21日 上午12:59
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Hi Friends,

By default the Guest role has the permission to view all the public pages of any User, any Organization or any Community. I want to disable this feature, I want that Guest role should have a permission to view only the public pages under the Guest Community.

Any help would be highly appreciated.

Many Thanks and Regards,
Nilesh.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月22日 上午1:10
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Can anyone please help on this please?

Regards,
Nilesh
Jignesh Thakkar
RE: Guest role permission to view all the public pages want to disable
2011年6月23日 上午12:48
答复

Jignesh Thakkar

等级: New Member

帖子: 24

加入日期: 2010年5月9日

最近的帖子

Hi Nilesh

Based on your requirement, you have other option also, like to create the private page of Community and Organization except Guest Community.

In Liferay,by default private pages are not visible to guest.

So you can try this one also.

let me know if you want more information
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月23日 上午1:03
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Hi Jignesh,

Thanks a lot for your reply.

If I go with the above solution, I think this will also restrict the other logged in users (who are not the member of the particular Organization) from visiting these private pages.

What I am looking for is that I want these pages of Organization to be accessed by all the Logged in users but not by the guest.

Please help.

Thanks and Regards,
Nilesh.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月27日 下午9:58
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Any solution please?
Jan Gregor
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午1:14
答复

Jan Gregor

等级: Regular Member

帖子: 224

加入日期: 2010年10月20日

最近的帖子

Hi Nilesh,

I think the solution was already proposed. By settting the organization or community private, only members and thus logged users can access those pages. You can also create a model-listener hook, which will apply your custom permission logic after adding/updating a new page.

Regards,

Jan.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午1:22
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Hi Jan,

Thanks a lot for your reply.

I am aware about the Communities to be Open/Restricted/Private. But I didnt find same for the Organization. I mean I am not getting any option for mentioning the same for Organization. If I am missing something then please let me know.

Thanks and Regards,
Nilesh.


Jan Gregor:
Hi Nilesh,

I think the solution was already proposed. By settting the organization or community private, only members and thus logged users can access those pages. You can also create a model-listener hook, which will apply your custom permission logic after adding/updating a new page.

Regards,

Jan.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午1:28
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Sorry, I didnt mention the LR version I am using. It is Liferay 6.0.6 CE.
Jan Gregor
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午1:35
答复

Jan Gregor

等级: Regular Member

帖子: 224

加入日期: 2010年10月20日

最近的帖子

Hi Nilesh,

Each organization has its private/public pages. For you the best option will be to create only private pages for each organization. These pages have automatically removed the view premission for Guest role. As mentioned before, you can always create your model-listener hook for Layout object, which will set your preffered permissions after each operation done on Layout object.

Regards,

Jan.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午3:09
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Thanks Jan for the reply.

As I already mentioned in this thread, creating all the pages of Organization to be private, does not seem to solve my problem. Just trying to elaborate it little more: -

There are 3 kinds of users in this context : -
1) Organization Members (These are the user who are members in the Organization)
2) Logged-in Users (These all the users having their account in Portal and logged in)
3) Guest Users (These are the non-logged in users)

Now I want to have to pages for an Organization which should be accessed by (1) Organization Members and (2) Logged-in Users.
But not by the (3) Guest Users

If I make the private pages for an Organization, I agree these will not be accessible to (3) Guest Users. But these will neither be accessible by (2) Logged-in Users.

Well, I feel that the only solution seems to be "Model-Listener Hook". But still if there is some easy solution then let me know.

Many Thanks and Regards,
Nilesh.
Dhrutika Vyas
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午3:33
答复

Dhrutika Vyas

等级: Expert

帖子: 435

加入日期: 2009年2月9日

最近的帖子

Nilesh Gundecha:
Thanks Jan for the reply.

As I already mentioned in this thread, creating all the pages of Organization to be private, does not seem to solve my problem. Just trying to elaborate it little more: -

There are 3 kinds of users in this context : -
1) Organization Members (These are the user who are members in the Organization)
2) Logged-in Users (These all the users having their account in Portal and logged in)
3) Guest Users (These are the non-logged in users)

Now I want to have to pages for an Organization which should be accessed by (1) Organization Members and (2) Logged-in Users.
But not by the (3) Guest Users

If I make the private pages for an Organization, I agree these will not be accessible to (3) Guest Users. But these will neither be accessible by (2) Logged-in Users.

Well, I feel that the only solution seems to be "Model-Listener Hook". But still if there is some easy solution then let me know.

Many Thanks and Regards,
Nilesh.



Hi Nilesh,

One solution that might fulfill your requirement.

When you create page, Under Manage pages you will see 'Page' tab
There you will find Save,Permissions and Delete buttons.
Click on permissions and uncheck Guest view permission and Save it.

Regards,
Dhrutika
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午3:42
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Thanks Dhrutika.

This solution looks good. This can fulfill my requirement.

I feel there must be some configuration in Liferay for defining the default permissions for the pages. If I get this, then the task of configuring permissions for every page creation can also be saved.

Will check and post if I get it.

Many Thanks,
Nilesh.
Dhrutika Vyas
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午3:52
答复

Dhrutika Vyas

等级: Expert

帖子: 435

加入日期: 2009年2月9日

最近的帖子

Hi Nilesh,

Good to know it helped you.

it would be nice if we have such configuration for pages. Please share it if you get any other solution.

Regards,
Dhrutika
Jan Gregor
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午5:43
答复

Jan Gregor

等级: Regular Member

帖子: 224

加入日期: 2010年10月20日

最近的帖子

Hi Nilesh,

Well, i dont think you fully understand the concept of Liferay.

If you want to access organization pages by logged in users, then you must

1. make pages private (this will disable non-authenticated users and also not members to see those pages)
2. assign users, who should see these pages into that organization.

By using these steps you will be able to have exactly the behaviour you would like to have. Setting permission by hand is no solution, as it will lead to inconsistence and a lot of bugs caused by human factor.

Regards,
Jan.
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年6月28日 上午6:27
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Hi Jan,

I appreciate your guidance.

But your suggested solution will force me to assign all the users to that Organization. Because I want every authenticated (logged-in) user to view the Organization Pages.
And assigning all the authenticated users to an Organization will change my business requirement.

To the best of my knowledge of LR permission system - "Organization private pages can be viewed only by the Organization Members".
If my this understanding is wrong then please let me know.

And in my current implementation, I already have public as well as private pages for the Organization, as shown below: -

1) Private Pages : - Only to be viewed by the Organization members.
2) Public Pages : - To be viewed by all the authenticated (logged-in) users. (But not by the Guest users)

I hope you understand my requirement.

Regards,
Nilesh.
Joel Peterson
RE: Guest role permission to view all the public pages want to disable
2011年8月3日 下午12:33
答复

Joel Peterson

等级: New Member

帖子: 22

加入日期: 2010年2月18日

最近的帖子

Nilesh,
One possible approach for automating the permissions strategy that you want would be to create a model-listener hook for the Layout model. From that model listener you should be able to specify that after a Layout (Page) is created, remove the Guest role's view access for the page if it belongs to a Group that is not the guest community. Alexey Kakunin has a blog post, http://www.emforge.net/web/akakunin/blogs/-/blogs/225270, where he explains how to create a model listener through hook for Liferay 6.

Joel
Nilesh Gundecha
RE: Guest role permission to view all the public pages want to disable
2011年8月3日 下午9:47
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Joel Peterson:
Nilesh,
One possible approach for automating the permissions strategy that you want would be to create a model-listener hook for the Layout model. From that model listener you should be able to specify that after a Layout (Page) is created, remove the Guest role's view access for the page if it belongs to a Group that is not the guest community. Alexey Kakunin has a blog post, http://www.emforge.net/web/akakunin/blogs/-/blogs/225270, where he explains how to create a model listener through hook for Liferay 6.

Joel


Thanks a lot Joel for your help. I will try out this stuff and will comment here once its done.
Suyash Bhalekar
RE: Guest role permission to view all the public pages want to disable
2013年4月18日 下午12:16
答复

Suyash Bhalekar

等级: New Member

帖子: 18

加入日期: 2012年9月4日

最近的帖子

Hi Nilesh,

I am having same requirement. That is to disable view permission of page on creation so that I can proceed with my other logic.
Currently I have to manually disable view option from manage permission tab of page.

Have you got the solution for this, or have you tried with Listener concept mention above?

Please reply as soon as possible.

Thanks.