cancel
Showing results for 
Search instead for 
Did you mean: 

Search files via Lucene & filter results by User Permission

junieboy
Champ in-the-making
Champ in-the-making
Hi,

I'm working on the search capability using Alfresco's Lucene search API through web services, mainly searching files using metadata (aspects defined in a custom dynamic model). Is it possible to restrict your query/search results with the permissions of the user to the file/space?

We don't want the users seeing the files they don't have access/permission to in the Lucene search results. Hope someone could point me on the approach. Thanks.

Regards
5 REPLIES 5

loftux
Star Contributor
Star Contributor
This is the default behaviour, search is evaluated using the permissions for the logged in user.
http://wiki.alfresco.com/wiki/Search

junieboy
Champ in-the-making
Champ in-the-making
This is the default behaviour, search is evaluated using the permissions for the logged in user.
http://wiki.alfresco.com/wiki/Search

Hi Loftux,

What if I am using a generic account to authenticate? Is there a way to leverage this kind of behaviour? Assuming I have a web application which uses the Alfresco web services API (Lucene Search) in the backend but the account used to authenticate to Alfresco is a generic account. Thanks.

loftux
Star Contributor
Star Contributor

junieboy
Champ in-the-making
Champ in-the-making
There is runAs functionality, see http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/security/authentication/Auth...
Haven't used it myself, try searching the forums for more detailed info http://www.google.com/search?q=site:forums.alfresco.com+runas+java

Is it possible to run this class with the web services API? Thanks in advance!

junieboy
Champ in-the-making
Champ in-the-making
There is runAs functionality, see http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/security/authentication/Auth...
Haven't used it myself, try searching the forums for more detailed info http://www.google.com/search?q=site:forums.alfresco.com+runas+java

Is it possible to run this org.alfresco.repo.security.AuthenticationUtil class with the web services API? Thanks in advance!