Skip to Content
author's profile photo Former Member
Former Member

Assign permisions to a folder with a java program

Does any body knows how can i assign permision to a folder with a java program? I developed a program that create a folder but need assign it permisions.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2005 at 05:08 PM

    Hi. Prakash Singh.

    In the example code: For a user you would do the following, how can i assign a different user than the logon user ?

    Best Regards

    Ali Cruz

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sanketh,

      I m also facing the same problem

      com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(myUser);

      getting NullPointerException in this statement.

      If ur problems have got solved than please do guide me how did u get it solved.

      Im in great need of ur help.

      Please help me out.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2005 at 01:49 AM

    Hi Jose,

    For a group you would do the following.

    IResource resource = ResourceFactory.getInstance().getResource(rid, ctxt);
    IResourceAclManager aclmanager =  aclsecurityManager.getAclManager();
    IResourceAcl racl = aclmanager.createAcl(resource);
    IUMPrincipal everyone = WPUMFactory.getGroupFactory().getGroup("Everyone");
    racl.addEntry(aclmanager.createAclEntry(everyone, false, aclmanager.getPermission(IAclPermission.ACL_PERMISSION_READ), 0));

    For a user you would do the following.

    IResource resource = ResourceFactory.getInstance().getResource(rid, ctxt);
    IResourceAclManager aclmanager =  aclsecurityManager.getAclManager();
    IResourceAcl racl = aclmanager.createAcl(resource);
    com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
    racl.addEntry(aclmanager.createAclEntry(user, false, aclmanager.getPermission(IAclPermission.ACL_PERMISSION_READ), 0));

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:49 AM

    @Pankaj:

    Did you maintain the web dynpro references? If not, this may help: select your wd project folder, and got to properties. Select Web Dynpro References and then Tab Sharing references. Add PORTAL:sap.com/com.sap.km.application.

    Best regards

    Iris

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.