on 10-14-2008 6:26 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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
Hi Saurabh,
try this
Regards
DV
Need some more solutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this [Article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f74d7c0-0d01-0010-50b1-9810a1584b00]
Regards
BP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.