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

Cannot create project worksite in Profile2 with custom realms and roles

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.9.0, 2.9.1, 2.9.2, 2.9.3, 10.0
    • Fix Version/s: 10.0, 11.0
    • Component/s: Profile
    • Labels:
    • 10 status:
      Resolved
    • Previous Issue Keys:
      PRFL-836

      Description

      We use a !site.template.project realm for project sites with a maintain role called Organizer. Since the ProfileWorksiteLogicImpl.createWorksite is hard coded to add user with the "maintain" role, the create worksite feature is broken for custom roles.

      Steps to reproduce:

      1. Log in as admin and navigate to the realms tool
      2. Click on the !site.template realm and click save as, enter !site.template.project in the realm id text box and click save.
      3. Click on the !site.template.project realm, click on maintain in the roles list, click copy role, enter Organizer in the realm id box and click save.
      4. Repeat step 3 for the access role, calling the copied role Participant.
      5. Remove the access and maintain roles by selecting them and then clicking remove role.
      6. On the main page for the !site.template.project realm, change the maintain role text box from maintain to Organizer then click save
      7. Create a registered user, then log in as that user and navigate to Profile2 in their workspace.
      8. Click connections, then create worksite, enter a worksite name and click create.
      9. Refresh your browser.

      Instead of a new project site the user will see an unpublished site with a uid for the title and the only tool available in the site is the help tool. The following stack trace appears in catalina.out:

      org.sakaiproject.portal.api.PortalHandlerException: java.lang.IllegalArgumentException: addMember called with null role!
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
      caused by: java.lang.IllegalArgumentException: addMember called with null role!
      at org.sakaiproject.authz.impl.BaseAuthzGroup.addMember(BaseAuthzGroup.java:1031)
      at org.sakaiproject.site.impl.BaseSite.addMember(BaseSite.java:1744)
      at org.sakaiproject.profile2.logic.ProfileWorksiteLogicImpl.createWorksite(ProfileWorksiteLogicImpl.java:180)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:414)
      at org.apache.wicket.proxy.$Proxy151.createWorksite(null:-1)
      at org.sakaiproject.profile2.tool.pages.panels.CreateWorksitePanel$2.onSubmit(CreateWorksitePanel.java:135)
      at org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:101)
      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:156)
      at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:312)
      at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:157)
      at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
      at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
      at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:160)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:634)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:369)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
      at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
      at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1495)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doTool(ToolHandler.java:213)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:96)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
      at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1285)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:695)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      at java.lang.Thread.run(Thread.java:680)

      I am attaching a patch for trunk that replaces the maintain role constant with a call to get the site maintain role in ProfileWorksiteLogicImpl.createWorksite.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  steve.swinsburg Steve Swinsburg
                  Reporter:
                  ktakacs Kevin Takacs
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration