This discussion is archived
5 Replies Latest reply: Aug 2, 2013 11:59 AM by MeenakshiSundaram RSS

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

870095 Newbie
Currently Being Moderated
Hi,

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()
          .getProjectHome();
     
     
     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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points