Forums

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

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Stian Sigvartsen
Assign document view permission directly to user
January 29, 2012 12:22 PM
Answer

Stian Sigvartsen

Rank: Regular Member

Posts: 100

Join Date: August 27, 2010

Recent Posts

Does anyone know if it's possible to assign the VIEW permission for a particular document directly to a user?
I'm looking at implementing a self service portal where users can log in and download documents that have been made available for them, and only them, besides from site administrators who have access to all documents.

Given this requirement it seems sensible to add the documents to the site scope rather than a user's personal site. This is because...

1) The user should only be able to download the document. Not change it. Adding it to the user's personal site scope would give them owner permission.
2) The self service site admins would not be able to view lists of documents that are in other users' personal site scope.

Any thoughts would be appreciated.

-Stian
Amos Fong
RE: Assign document view permission directly to user
January 29, 2012 6:53 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

Hi Stian,

If it's an option, you could change the permission algorithm to 1-4, then you could assign permissions directly to the user. It's less efficient, but the other option I can think of is to make a role for each user.

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/permissio-4

 1    #
 2    # Set the algorithm used to check permissions for a user. This is useful so
 3    # that you can optimize the search for different databases. See
 4    # com.liferay.portal.service.impl.PermissionLocalServiceImpl.
 5    #
 6    # Algorithms 1 through 4 are essentially the same but make calls in different
 7    # orders depending on how the database is optimized and how the portal
 8    # permissions are used. Algorithm 5 moves to a completely role based
 9    # permissions check for better performance. Permissions by users are no
10    # longer supported, yet it uses the same table structure as algorithms 1-4.
11    #
12    # Algorithm 6 is the current algorithm for Liferay 6 and above. It supports
13    # role based permissions like algorithm 5, but does so by using only one
14    # table and bitwise operations. This makes it perform far better than the
15    # other algorithms.
16    #
17    #permissions.user.check.algorithm=1
18    #permissions.user.check.algorithm=2
19    #permissions.user.check.algorithm=3
20    #permissions.user.check.algorithm=4
21    #permissions.user.check.algorithm=5
22    permissions.user.check.algorithm=6
Jesús Salinas
RE: Assign document view permission directly to user
January 30, 2012 12:22 AM
Answer

Jesús Salinas

Rank: New Member

Posts: 15

Join Date: February 1, 2010

Recent Posts

Hi,

So, in Liferay 6.1, what can I do if I would like to define permissions over the concept "My friends". This group doesn't have any related role!
The only solution I found was define permissions over each user in a particular way, forgetting role concept.
Stian Sigvartsen
RE: Assign document view permission directly to user
February 19, 2012 1:33 PM
Answer

Stian Sigvartsen

Rank: Regular Member

Posts: 100

Join Date: August 27, 2010

Recent Posts

Thanks for your reply Amos. It might be possible to create a separate portal instance configured with an earlier permission check. Not my preferred option because then there would be multiple portals with separate user bases. Maybe this secondary issue can be mitigated via a SSO solution.

I've been reading a bit more about the Liferay 6.1 permission algorithm and the way the "owner" role has been implemented an "implied role" which is assigned at runtime based on a comparison between the logged in user and information held against a resource. Maybe it would be possible to add new "implied roles" such as one for allowing the access I require?

I've created a separate thread in the development forum to look into the problem from this perspective. Suspect doing so will require some development, because there doesn't appear to be any portal control panel screens covering it. If you have any thoughts then I would really appreciate to hear them emoticon

http://www.liferay.com/community/forums/-/message_boards/message/12572293
Pete J Johnson
RE: Assign document view permission directly to user
May 9, 2012 11:14 AM
Answer

Pete J Johnson

Rank: New Member

Posts: 4

Join Date: January 8, 2009

Recent Posts

Amos Fong:
Hi Stian,

If it's an option, you could change the permission algorithm to 1-4, then you could assign permissions directly to the user. It's less efficient, but the other option I can think of is to make a role for each user.

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/permissio-4


Hi,

We are using Liferay 6.1 GA1. Our users are imported via LDAP. I changed the permission algorithm to 4 and now when editing permissions i see that i have the option of users, organizations etc. However no available users are found for selection. Could this be related to LDAP? User groups are imported via LDAP also and they can be seen as available when editing permissions. We also have the need of user specific permissions. Creating a role for each user sounds a bit clumsy.

Thanks in advance