cancel
Showing results for 
Search instead for 
Did you mean: 

Problem whith Privilege 'AddChildren' is not granted

klebervz_
Confirmed Champ
Confirmed Champ

Hi,

I created one document the type (MissionNotification in Studio) with Extends = Document and Category = Miscellaneous, this document will be created when the other Document change the life cycle.

For this, I created an EventHandler with the code below :

public void process ( DocumentModel doc , CoreSession session ) throws ClientException {
    doc.getPathAsString ();
    DocumentModel notified session.createDocumentModel = ( " / default -domain " , doc.getTitle ( ) , " MissionNotification " ) ;
    notifi.setPropertyValue ( " dc: title " , doc.getTitle ( ) ) ;
    notifi.setPropertyValue ( " missionnotification : mission ," doc.getId ( ) ) ;
    Doc.getCurrentLifeCycleState String state = ( ) ;
    notifi.setPropertyValue ( " missionnotification : state " , state) ;
    notifi.setPropertyValue ( " missionnotification : fromState ",  Utils.getFromStateOfMission ( state) ) ;
    notifi.setPropertyValue ( " missionnotification : contributors ",  doc.getPropertyValue ( "dc : contributors "));
    notifi.setPropertyValue ( " missionnotification : responsible", doc.getPropertyValue ( " Mission : mission_responsible "));
    session.createDocument notification ( notification ) ;
    session.saveDocument notification ( notification ) ;
    session.save ( ) ;
}

When I try to create my ( document ) = session.createDocument notification ( notification ) ;

happens the following error :

ERROR [ http - 0.0.0.0 - bio - 8080 - exec - 4 ] [ org.nuxeo.ecm.core.event.impl.EventServiceImpl ] Error during sync listener execution missionNotification , transaction will not be rolled back since event.markRollBack ( ) was not called by the Listener org.nuxeo.ecm.core.api.DocumentSecurityException : Privilege ' addChildren ' is not granted to ' user1 ' at org.nuxeo.ecm.core.api.AbstractSession.checkPermission ( AbstractSession.java : 306 ) at org.nuxeo.ecm.core.api.AbstractSession.createDocument ( AbstractSession.java : 879 ) at org.br.ezute.event.MissionNotificationEventHandler.process ( MissionNotificationEventHandler.java : 58) at org.br.ezute.event.MissionNotificationEventHandler.handleEvent(MissionNotificationEventHandler.java:33) at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent ( EventServiceImpl.java : 215) at org.nuxeo.ecm.core.api.AbstractSession.fireEvent ( AbstractSession.java : 385 ) at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent ( AbstractSession.java : 437)

Only works when I 'm logged in as user with Administrator permission

Could someone help me ?

1 REPLY 1

klebervz_
Confirmed Champ
Confirmed Champ

Hi,