AnsweredAssumed Answered

cannot create object by normal user

Question asked by nick.l on Jun 24, 2013
Latest reply on Jun 26, 2013 by nick.l
I am using Alfresco 4.2.c and opencmis 0.8.0. When I connect Alfresco by Admin user, then he can create object. But if logging in as a user who is not in administration group and the home space has been set as /Company Home, then "cmispermissiondeniedexception:forbidden" exception occurs while creating folder/document under Company Home. When I login as the same user from Alfresco console, this user can actually create objects under Company Home.

Code is :
   Map<String, String> parameter = new HashMap<String, String>();

        parameter.put(SessionParameter.USER, userName);
        parameter.put(SessionParameter.PASSWORD, password);
        parameter.put(SessionParameter.AUTH_HTTP_BASIC, "true");

        parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
        parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
       
        // create session with the first (and only) repository
        SessionFactory factory = SessionFactoryImpl.newInstance();
        Session session = factory.getRepositories(parameter).get(0).createSession();

        Map<String, String> newFolderProps = new HashMap<String, String>();
        newFolderProps.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
        newFolderProps.put(PropertyIds.NAME, "folderName");
       
        Folder createdFolder = session.getRootFolder().createFolder(newFolderProps); //exception here


Outcomes