cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering of documents in KM

Former Member
0 Kudos

Hi,

I have created a repository in km, say, documents/demodocs in which user1 and user2 can add the documents. But the documents added by user1 should not be visible to user2 and vice-versa.

How can I achieve this ?

Helpful answers will be rewarded.

Regards,

Saurabh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Saurabh,

What if you just make two different folders inside your root folder like this

/documents/f1

/documents/f2

and you can give permissions over the folders,

f1 to user1(or groups g1, g2)

f2 to user2

So you can control the access to the files and you don't have to program, with an Navigation iView different users can see or handle different kind of info base upon their permissions.

Anyway, if you do want to program check this out https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6389

Regards

DV

Former Member
0 Kudos

Dear Diego,

Thanks for the solution, but this would be feasible if the no. of users are less. In my case the no. of users is around 90,000. So, I can't create folder for every user.

I tried using the code shared by you, but not getting the appropriate results. Any further references/ suggestions are most welcome.

Regards,

Saurabh

Former Member
0 Kudos

Hi Saurabh,

You didn't mention the 90000 users...

How about this, perhaps is a little tricky .. but...:

1. create a folder for example /docs/test

2. create a group yourGroup, and add all the users to that group.

3. In the KM Content give ownership permission to that group over the folder test, you have to remove any detail and permission command from any Navigation iView that users have access to, because of course they can change the permissions over the folder test if you let them.

4. Develop your own upload program

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1750In

5. Once the file is uploaded, inside the same program, first create a new acl, the document inherits the acl from the parent folder, so add the user as owner and remove the group.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1070413a-29e7-2a10-cc81-cdc92cdd...

like this

...

IUMPrincipal groupToBeRemoved =WPUMFactory.getGroupFactory().getGroup("yourGroup");

ISecurityManager sm = resource.getRepositoryManager(). getSecurityManager(resource);

if(sm != null && (sm instanceof IAclSecurityManager)) {

IAclSecurityManager asm = (IAclSecurityManager)sm;

IResourceAclManager ram = asm.getAclManager();

IResourceAcl ra = ram.getAcl(resource);

if(ra == null){

ra = ram.createAcl(resource);

ra.addOwner(resource.getContext().getUser());

ra.removeOwner(groupToBeRemoved);

}

Now, You have a folder with documents from different users, user A can't see files from user B, but in the upload program you have to take special care about the names of the files to upload. If user A wants to upload the file name foo.txt and the user B already did upload a file with that name, your program gonna generate an

NameAlreadyExistsException.

Hope this help...

regards

DV

Former Member
0 Kudos

Hi DV,

First of all, excuse me for the brevity on my problem and thanks for the another approach suggested. But in the given solution I am not able to open the following thead.

4. Develop your own upload program
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1750In

It seems that this thread is removed. So, kindly share another thread if you have or paste the code here only, if possible.

Regards,

Saurabh

Former Member

Answers (3)

Answers (3)

Former Member
0 Kudos

Need some more solutions.

Former Member
0 Kudos

Is it possible to achieve this using NameSpace filter ? If yes, then please describe the steps needed.

Any sample code will be more appreciable.

Regards,

Saurabh

former_member188556
Active Contributor
0 Kudos

Hi,

Check this [Article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f74d7c0-0d01-0010-50b1-9810a1584b00]

Regards

BP

Former Member
0 Kudos

Thanks BP.

But from where I can get the SingleFolderMultipleAuthors.par, as mentioned in the doc ?

Regards,

Saurabh

former_member188556
Active Contributor
0 Kudos

Hi Saurabh

[Par Link|https://www.sdn.sap.com/irj/sdn/howtoguides?rid=/library/uuid/5019c983-4e17-2a10-9c9d-98692ecca661]

Regards

BP

Former Member
0 Kudos

Thanks a lot BP. It seems to be helpful to me.

Regards,

Saurabh