Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Tim Cardwell
Getting site folders based on user roles
February 14, 2013 3:46 PM
Answer

Tim Cardwell

Rank: Junior Member

Posts: 27

Join Date: July 19, 2012

Recent Posts

I want to know if there is a liferay API call that will return only the folders on the site that the current user has access too.

For example:
Let's say I use the simple DLFolderLocalServiceUtil.getDLFolders(-1, -1) call to return all folders on the site. Will this return all folders on the site, or will it only return the folders that the currently logged on user executing this code has access to?

I know I could get all the folders than cross reference them with the current user's role and then figure out if a user can view them, but I don't want to do that.

I suppose this question boils down to this: Is it the developer's responsibility to ensure a user only has access to files and folders corresponding to their role? Or will liferay take care of this for me in it's API.

Thanks,
-Tim