Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-51693

Old calendar model-resource permission are not migrating properly when define role

Details

    Description

      Reproduced Steps:
      1. In the clean instance of Liferay 6.1.20-ee-ga2.
      2. Go to Control Panel >> Roles >> , create regular role "hai".
      3. Define Permission all com.liferay.portlet.calendar and com.liferay.portlet.calendar.model.CalEvent permission for the role Hai. For example:
      Resource:Calendar Event, Action:Add Discussion
      4. Upgrade from 6.1.20 to 6.2 SP7. (Added passwords.encryption.algorithm.legacy=SHA in portal-ext.properties.)
      5. In 6.2 SP7, go to view role "hai" permission, you will see "8 > model.resource.com.liferay.portlet.calendar.model.CalEvent: Add Discussion". This is not correct behaior.

      We have different defination model resource and model resource's actionId between 6.1 and 6.2.

      I should make sure "com.liferay.portlet.calendar"(6.1) matches with "com.liferay.calendar.model.Calendar"(6.2), and "com.liferay.portlet.calendar.model.CalEvent" matches with "com.liferay.calendar.model.CalendarBooking"(6.2) by checking CalendarImporterLocalServiceImpl.importCalEvent() method.

      We can't ignore action-key difference by referring CalendarImporterLocalServiceImpl.getActionId() method. We need to discard those actionIds which don't exist in 6.2 calendar.

      For example:
      in 6.1
      <model-resource>
      <model-name>com.liferay.portlet.calendar</model-name>
      <action-key>ADD_EVENT</action-key>
      <action-key>EXPORT_ALL_EVENTS</action-key>
      <action-key>PERMISSIONS</action-key>
      </model-resource>

      in 6.2
      <model-resource>
      <model-name>com.liferay.calendar.model.Calendar</model-name>
      <supports>
      <action-key>DELETE</action-key>
      <action-key>MANAGE_BOOKINGS</action-key>
      <action-key>PERMISSIONS</action-key>
      <action-key>UPDATE</action-key>
      <action-key>VIEW</action-key>
      <action-key>VIEW_BOOKING_DETAILS</action-key>
      <model-resource>

      If one regular role own all "com.liferay.portlet.calendar" action-key, after upgrading to 6.2, this role should only own PERMISSIONS action-key, ADD_EVENT and EXPORT_ALL_EVENTS should be not added to this role.

      Attachments

        Issue Links

          Activity

            People

              hai.yu Hai Yu
              hai.yu Hai Yu
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                7 years, 51 weeks, 5 days ago

                Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M4