Project

General

Profile

Actions

Defect #1320

closed

Approve/Reject/Return to applicant buttons appears after refresh

Added by Vladimír Kotýnek about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Vít Švanda
Category:
Workflow
Target version:
Start date:
10/12/2018
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

Affected version: 9.2.0
  • configured idm.sec.core.wf.approval.manager.enabled=true
  • configured idm.sec.core.wf.role.approval1=approve-role-by-manager
  • created role bcv-test with criticality=1
  • as "admin" requested the role for user jdoe
  • task for his manager was created
  • click to tasks/all
  • opened the task
  • no Approve/deny buttons were present
  • Pushed F5 button on my keyboard
  • Page refreshed
  • Approve/Reject/Return to applicant buttons apeared

I don't know which of these situations is correct. The one before F5 or the one after F5? However, the view of the task should stay consistent.

When I click on "Approve" I've got

"12.10.2018 15:16:50
Insufficient permissions
You do not have sufficient permissions for selected action."

error message.


Files

task.gif (1.37 MB) task.gif Vladimír Kotýnek, 10/12/2018 01:14 PM
Actions #1

Updated by Vít Švanda about 6 years ago

  • Target version set to Onyx (9.3.0)
Actions #2

Updated by Vít Švanda about 6 years ago

  • Assignee changed from Vít Švanda to Ondřej Kopr
Actions #3

Updated by Ondřej Kopr about 6 years ago

  • Status changed from New to Needs feedback
  • Assignee changed from Ondřej Kopr to Vít Švanda
  • Target version changed from Onyx (9.3.0) to Morganite (9.2.2)
  • % Done changed from 0 to 90

I fixed this. Thank you for nice description of the problem. Gif is very useful.

At first moments I thing it will be super easy fix, but the problem was not with showLoading. So I changed only one line, but debug was harder. Refresh and get permissions now works correctly. Please Vitek could you make a review? Thank you.

Commit: https://github.com/bcvsolutions/CzechIdMng/commit/9fff317637c63b352fb3b3863caad30f61edf538 (develop - 9.2.2-SNAPSHOT)

Actions #4

Updated by Vít Švanda about 6 years ago

  • Assignee changed from Vít Švanda to Ondřej Kopr
Your fix works, but I think the primary problem is in something different.
  • Returns DTO (Task) depends on the permission. If user has right on execute task are "generated" buttons (as metadata in task DTO).
  • Problem is in the AbstractReadDtoController, where is DTO first loaded without permission and after that is DTO checked on permission.READ. The occurrs problem, because returned DTO has metadata for execute buttons (DTO was loaded without rights).
  • I fixed that with override getDto method in task controller. Better solutions will be modified calling the lookup service directly with permissions, but that is bigger change.
Actions #5

Updated by Ondřej Kopr about 6 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Vít Švanda
  • % Done changed from 90 to 100

I simulate the issue and after your changes and it works correctly. Thanks for you change my code I'm so happy now :D.

Please close the ticket.

Actions #6

Updated by Vít Švanda about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF