Foros de discusión

Permission for a special category of web-content

Samir EL KHAMLICHI, modificado hace 10 años.

Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
Hi,

I want to know how it's possible to create a user with specific Role and with a sepecific permissions for a special category of web content like (Sport news, IT news, ...).

For example create a user with Sport news Role who can add and modify only sport news category of Web content.

The probleme is if i activate for example Web content permissions for Sport news Role the user have a complete access to all Web content and can modify any Web Content in portal.

I use Liferay 6.

Thanks.
samir
thumbnail
Milen Dyankov, modificado hace 10 años.

RE: Permission for a special category of web-content

Expert Mensajes: 310 Fecha de incorporación: 30/10/12 Mensajes recientes
Currently this is not possible OOTB but it's quite easy to work around it.

If you don't have too much content you can have your editors manually change permissions when they add content.
For example lets assume you have 'Sport news editor', 'IT news editor' , ... roles. Then when someone in 'Sport news editor' role adds content she can change the content's update/delete permissions (allow only 'Sport news editor' role). This will take care of updating/deleting existing contents. But all editors will still need to be able to create new content and they can choose any type for it. To work around this you can use categories instead of content types as you can define permissions for categories.

If you have a lot of content and manual permission change is not an option, you can implement a hook (model listener or service wrapper) to automate that.
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
Thanks Milen, it works fine.
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
I have problem with category, i want to have a public editor category which can publish a public content but only the public editor can publish these category of content, now i have these roles (Public editor, Sport news editor', IT news editor) The problem when i activate the permission "view" to any roles (Sport news editor', IT news editor, ...) for public category, the public content is visible for these roles but any user with this roles can choose public category when he create a web content and so create a public content reserved to the public editor.
thumbnail
Milen Dyankov, modificado hace 10 años.

RE: Permission for a special category of web-content

Expert Mensajes: 310 Fecha de incorporación: 30/10/12 Mensajes recientes
Perhaps I don't quite understand your question but why don't you simply give view permission on 'public category' to 'Public editor' role only?
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
If i give just a view permission on 'public category' to 'Public editor' role only, the problem is that the content of public category were not be visible for any roles.

So i want to have something like:
Categories:
Public Category: - Only the public editor can publish these category of the content
- All user with any role can read these category of content

Private category: - Only the private editor can publish these category of the content
- Just a user with a "Private Editor" role can read these category of the content

Roles:
Public editor: Role give permission to publish public content (Public category)
Private editor: Role give permission to publish private content (Private category)

I use asset publisher to display these content (Filter: public category, private category)
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
Any ideas?
thumbnail
Milen Dyankov, modificado hace 10 años.

RE: Permission for a special category of web-content

Expert Mensajes: 310 Fecha de incorporación: 30/10/12 Mensajes recientes
Do you need your end users to actually see the category? If not, then perhaps you can configure AssetPublisher to only display articles from given category. I haven't tried but I think this should work even if the current user does not have the right to see the category. If it does, you can have different instances of AssetPublisher for different users.
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
I think i wasn't clear.

Yes, i want end user with Guest, Public, Private,... roles to have access (to read) to the public content (Public Category).

Actualy i have:
Categories:
Public:
- Only the public editor can publish these category of the content
- All user with any role (Guest, Public editor, Private editor, ...) can read these category of the content

Private:
- Only the private editor can publish these category of the content
- Just a user with a "Private Editor" role can read these category of the content

Roles:
Public editor: Role give permission to publish public content (Public category)
Private editor: Role give permission to publish private content (Private category)

I use asset publisher to display public and private content, i use a filter to display only public category and private category of the web content.

A user with "Private" role can read and publish the private content (private category) and read the public content (public category)
A user with "Public" role can read and publish the public content (public category) and can not read and publish the private content (private category)
A user with "Guest" role can read the public content (public category) and can not read and publish the private content (private category)

If i give a view permission on 'public category' to any role like "private editor", the content of public category is displayed for a user with private editor role but the probleme, the user with private editor can create a web content with public category (Only Public editor role can create a public content)

The probleme is that the view permission on any category don't make difference between the pemission to read the content of this category and the permission to create a content with this category.
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
Any ideas plz?
thumbnail
Milen Dyankov, modificado hace 10 años.

RE: Permission for a special category of web-content

Expert Mensajes: 310 Fecha de incorporación: 30/10/12 Mensajes recientes
I'm still not sure I understand your scenario. Perhaps because your understanding of "private" and "public" is a bit different then what the portal assumes. So let me try to explain what I would do using some simple example. The you can tell me which part does not work for you.

- Create 2 roles: "Sport news editor" and "Tech news editor"
- Create 2 categories: "Sport news" and "Tech news"
- Give 'view' permission on "Sport news" to "Sport news editor" role only
- Give 'view' permission on "Tech news" to "Tech news editor" role only
- Add an instance of AssetPublisher configured to display content in "Sport news" (lets call it SportAP)
- Add an instance of AssetPublisher configured to display content in "Tech news" (lets call it TechAP)

This way even though the end users don't have view permissions on the categories they can see the articles.
Now if you have 2 groups of users (one that can only see sport news and another that can only see tech news) you can
- create 2 more roles "Sport news member" and "Tech news member"
- assign your users to appropriate category
- make SportAP visible only for "Sport news member" category
- make TechAP visible only for "Tech news member" category

In general this should work but keep in mind that since the content itself is not protected:
- users will be able to search and find and content. To work around this you can hook the search and dynamically update the search criteria to contain the category as well
- user will be able to see content in different category if they are given a direct link

I hope this helps!
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
Thank you Milen for your help, your example work fine for me, just one problem the end users (Guest) can't see the article of "Sport news" and "Tech news" category if guest role don't have view permissions on the categories.

The problem if i give view permission on the categories ("Sport news" and "Tech news") to end users (Guest) any role wil get this permission because by default any role have guest permissions.
thumbnail
Milen Dyankov, modificado hace 10 años.

RE: Permission for a special category of web-content

Expert Mensajes: 310 Fecha de incorporación: 30/10/12 Mensajes recientes
Samir EL KHAMLICHI:
Thank you Milen for your help, your example work fine for me, just one problem the end users (Guest) can't see the article of "Sport news" and "Tech news" category if they don't have view permissions on the categories.


Hmm, this should work. I just did a quick test on latest master (the upcoming 6.2) and it works just fine. Which Liferay version you use? It could be there is a bug it some older version.

Btw, it just came to my mind that you could actually use WCM structures (and of course templates) instead of categories. It should work in the same way (permission for structures and then choose in AssetPublisher only articles using given structure). You may have a better luck with this approach.
Samir EL KHAMLICHI, modificado hace 10 años.

RE: Permission for a special category of web-content

New Member Mensajes: 13 Fecha de incorporación: 26/07/13 Mensajes recientes
I use Liferay Portal Enterprise Edition 6.1.20 EE.

Ok Milen, i will try to use WCM Structure/template.