Uploaded image for project: 'JCommune'
  1. JCommune
  2. JC-1008

User can save profile when it is not allowed.

VotersWatchers
    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20 Larks
    • Fix Version/s: 1.5 Larks
    • Labels:
      None

      Description

      1. Check that user has EDIT_PROFILE permssion.
      2. Go to user profile page
      3. click 'edit profile' button (don't close this tab)
      4. Go to admin panel in another tab
      5. Add 'registered users' group to restricted section for EDIT_PROFILE permission.
      6. Back to tab with 'edit profile' page and click save.

      AR: profile is saved
      ER: no permission page should be displayed.

      NOTE:
      TransactionalUserService.editUserProfile(UserInfoContainer info)
      on the 2nd line checkPermissionsToEditProfile(currentUser.getId()); is called

      @PreAuthorize("hasPermission(#userId, 'USER', 'ProfilePermission.EDIT_PROFILE')")
      public void checkPermissionsToEditProfile(Long userId)

      { LOGGER.debug("Check permission to edit profile for user - " + userId); }

      it doesn't work because @PreAuthorize is evaluated by Spring when proxy method is called (e.g. when user
      calls method of injected service), but here method of real class is called (method of this class).

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  sasha2888 Alexandra Pancheshenko
                  Reporter:
                  lamao Vyacheslav Mishcheryakov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0h
                    0h
                    Logged:
                    Time Spent - 2.5h
                    2.5h

                      Structure Helper Panel