[Building Sakai] help with a PermissionException problem

Xiaolin Xie alphabnu at gmail.com
Thu Aug 23 08:17:29 PDT 2012


Hi Sakai developers.



I am developing an instructor only tool that compiles student answers to
forms in a matrix. It works fine when the Sakai administrator accesses this
tool. However, there is a problem with instructor access.



This is the exception stack trace:

INFO: [SuTool] Username admin becoming xxxxx (2012-08-22 09:50:17,570
TP-Processor10_org.sakaiproject.tool.su.SuTool)

org.sakaiproject.exception.PermissionException
user=70382d1d-a91d-4913-a41d-4e6996a1a5ba lock=content.read
resource=/content/user/5cd94b20-4948-4711-9846-debd42fa3988/portfolio-interaction/demo_coe_2/BF9F9D8DE3B53AC9FE5792CA9BC074BF/6FE9B7A62C703EED28E04E0B3F9B20BB/E55398AAA29DC42C4A05937209D0B57D

at
org.sakaiproject.content.impl.BaseContentService.unlock(BaseContentService.java:1677)

at
org.sakaiproject.content.impl.BaseContentService.getResource(BaseContentService.java:4174)

at
org.sakaiproject.matrixreport.logic.ExternalLogicImpl.getContentStringByUuid(ExternalLogicImpl.java:232)





This is the code where the exception happens. It tries to access the xml
content of students’ answers to forms in matrix.

   *public* String getContentStringByUuid(String uuid){

            String str=*null*;

            ContentResource cr;

            *try* {

                  String id=contentHostingService.resolveUuid(uuid);

                  cr = contentHostingService.getResource(id);

                  str=*new* String(cr.getContent());

            } *catch* (PermissionException e) {

                  e.printStackTrace();

            } *catch* (IdUnusedException e) {

                  e.printStackTrace();

            } *catch* (TypeException e) {

                  e.printStackTrace();

            } *catch* (ServerOverloadException e) {

                  e.printStackTrace();

            }

            *return* str;

      }



I don’t understand why instructor does not have the access to students’
answers to forms in the matrix because the instructor can view it through
the  matrix tool.



Are there any problems with my code? Or how should I access these
resourceses?  Do you guys have any idea what might cause that exception?
Thanks a lot! I really appreciate any help you can offer.



Xiaolin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120823/01018f5d/attachment.html 


More information about the sakai-dev mailing list