Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-30364

PermissionException from Subetha email archive switch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 11.0
    • Fix Version/s: 11.0, 12.0
    • Component/s: Email Archive
    • Labels:
      None
    • 11 status:
      Resolved

      Description

      When sending to a site (that I believe is an alias) it's getting a permission exception after this code change. Looking at the the original code in SakaiMailet.java it actually runs this user switch if there is no Session.

      It needs to look up this alias because I guess that's how email archive stores it's references?

      testtest

      /mailarchive/channel/Oceanography/main

      		try
      		{
      			// set the current user to postmaster
      			Session s = sessionManager.getCurrentSession();
      			if (s != null)
      			{
      				s.setUserId(postmaster.getId());
      			}
      			else
      			{
      				M_log.warn("service - no SessionManager.getCurrentSession, cannot set to postmaser user, attempting to use the current user ("
      				        +sessionManager.getCurrentSessionUserId()+") and session ("+sessionManager.getCurrentSession().getId()+")");
      			}
      

      I don't see anything like this retained, I'm guessing some of this might need to be?

      2016-02-23 18:22:14,544  WARN org.subethamail.smtp.server.Session-/127.0.0.1:39258 org.sakaiproject.mailarchive.SakaiMessageHandlerFactory - No access to alias, this should never happen.
      org.sakaiproject.exception.PermissionException: user=null lock=mail.read resource=/mailarchive/channel/Oceanography/main id: /mailarchive/channel/Oceanography/main
      	at org.sakaiproject.message.util.BaseMessage.unlock(BaseMessage.java:545)
      	at org.sakaiproject.message.util.BaseMessage.getChannel(BaseMessage.java:637)
      	at org.sakaiproject.mailarchive.impl.BaseMailArchiveService.getMailArchiveChannel(BaseMailArchiveService.java:694)
      	at org.sakaiproject.mailarchive.SakaiMessageHandlerFactory$1.getMailArchiveChannel(SakaiMessageHandlerFactory.java:397
      
      

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  buckett Matthew Buckett
                  Reporter:
                  jonespm Matthew Jones
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration