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

Journal - Edit article : a user with "Add article" permission cannot update his articles after save

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.2
    • Fix Version/s: 5.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Liferay 5.1.2 Tomcat 5.5 Windows.

      Description

      A user has "Add article" permission. (not approve permission)
      The user can add an article and save it.
      After 1st "save" or "save and continue", the user cannot update his article. He should be able to do that.
      Update permission cannot be set at the same level as we set the "add article" permission, which result in inconsistency, and make journal unusable.

      Here is my proposed fix, which is "quick&dirty", i.e. I do not know if it should be applied on other pages/portlets. I think there is no or very limited impact (regression tests).

      File: "edit_article.jsp" in "./html/portlet/journal"

      <%
      boolean hasSavePermission = false;

      if (article != null)

      { hasSavePermission = JournalArticlePermission.contains(permissionChecker, groupId, articleId, ActionKeys.UPDATE) || article.getUserId() == permissionChecker.getUserId(); }

      else

      { hasSavePermission = PortletPermissionUtil.contains(permissionChecker, plid, PortletKeys.JOURNAL, ActionKeys.ADD_ARTICLE); }

      %>

      I added a condition to test the article ownership.
      Hope this helps.

      Regards
      Hervé

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  8 years, 41 weeks, 5 days ago