5 Replies Latest reply on Aug 2, 2013 6:59 PM by MeenakshiSundaram

    Permissions denied when trying to get a BCC project programatically...


      I wrote a servlet that extends atg.servlet.GenericServletService and in the service method, I am resolving the ATG component that is trying to query a BCC project with the given project Id.

      The control is getting passed successfully to the ATG component but when it is trying to query, its throwing the following error:

      14:46:02,741 ERROR [STDERR] javax.ejb.EJBException: QUERY_EXCEPTION_MESSAGE: RQL query: id = ?0, Args: ?0=prj2130001
      14:46:02,743 ERROR [STDERR]      at atg.repository.tojava.runtime.RJSupport.executeRqlStatementForOne(RJSupport.java:1110)
      14:46:02,744 ERROR [STDERR]      at atg.epub.project._ProjectHome_ReposImpl.findById(_ProjectHome_ReposImpl.java:70)

      *14:46:02,761 ERROR [STDERR] Caused by: CONTAINER:atg.repository.RepositorySecurityException; SOURCE:atg.security.PermissionDeniedException: You do not have read access to the project item descriptor.*
      14:46:02,762 ERROR [STDERR]      at atg.adapter.secure.GenericSecuredRepository.checkAccess(GenericSecuredRepository.java:381)
      14:46:02,763 ERROR [STDERR]      at atg.adapter.secure.GenericSecuredRepositoryView.executeQuery(GenericSecuredRepositoryView.java:292)
      14:46:02,763 ERROR [STDERR]      at atg.repository.rql.RqlStatement.executeQuery(RqlStatement.java:205)
      14:46:02,764 ERROR [STDERR]      at atg.repository.tojava.runtime.RJSupport.executeRqlStatementForOne(RJSupport.java:1099)

      I am using the following API:

           final ProjectHome projectHome = ProjectConstants.getPersistentHomes()
           Project project = projectHome.findById(projectId);

      I am invoking this servlet from the web browser by passing the project ID as the parameter.

      However, if I try to invoke the same component's method using a scheduler, its working fine.

      Any help/pointers regarding this is greatly appreciated.

      Thanks in advance.