Project

General

Profile

Actions

Task #1821

closed

Not possible to edit ldapGroup script with dollar in group name

Added by Petr Hanák over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Vít Švanda
Category:
Systems
Target version:
Start date:
08/26/2019
Due date:
% Done:

100%

Estimated time:
Owner:

Description

In version 9.3.0 I was trying to change double quotes to single quote, but I was not able to re-save script in ldapGroup merge attribute on AD group.
I did workaround - delete system on AD group and add again.
I recorded gif which is in attachment.


Files

Actions #1

Updated by Petr Hanák over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Petr Hanák over 4 years ago

  • File deleted (Cant save dollar in ldapGroup script.gif)
Actions #4

Updated by Vít Švanda over 4 years ago

  • Category set to Systems
  • Status changed from New to In Progress
  • Assignee changed from Radek Tomiška to Vít Švanda
  • Target version set to Rhyolite (9.7.5)
Actions #5

Updated by Vít Švanda over 4 years ago

Primary problem is in your script "testDollar$Test". This is not correct script, because groovy try to find variable "Test".

Good question is why was this script successfuly saved, if every saved attribut should be validate. The reason is simple, this script is valid (for example this is unvalid script "testDollar$"), but cannot be evalued (because variable "Test" missing).

So your exception is not throwing during validation of the script, but during evaluation of that script (because I try to save historic value if the attribute was changed).

My advice is: Do not save incorrect scripts :-). If you have some automatically utility for create this attributes (may be some WF), you have to fix it, because generating incorrect scripts.

I want to prevent this situation for next time. So I modified saving of the attribute and script is validate and executed now too. For next time will be not possible to create attribute with incorrect groovy script.
I modified save method for situation when the attribute (script) is already broken. In this case need to obtain old value (for save historic value). If script exception will be throw in this situation I only catch the exception and historic value will be not saved.

Commit: https://github.com/bcvsolutions/CzechIdMng/commit/454933a3d9a728f5f65354d984812ee2f8978ac8

Actions #6

Updated by Vít Švanda over 4 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Vít Švanda to Radek Tomiška
Actions #7

Updated by Radek Tomiška over 4 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 100

I did test and review, it works and code is nice. Message with validation error is returned for user and old invalid script can be changed by valid one. Thx!

Actions #8

Updated by Vít Švanda over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF