Project

General

Profile

bug #7874

TeamOrPersonBase entity can become unusable due to replacement of the title caches on using getters

Added by Andreas Kohlbecker 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
10/26/2018
Due date:
% Done:

50%

Severity:
critical
Found in Version:
Tags:

Description

This issue is quite good explainable by the case examined in #7870#note-1 :

The initial problem is cause by the protectedNomenclaturalTitleCache flag of the Team being set to false. When binding the data to the UI the getNomenclaturalTitle() is called which causes the the nomenclaturalTitle being updated using the cache strategy. The value stored in the db is now different from the value contained in the nomenclaturalTitle-field:

nomenclaturalTitle in db:

Turland, Wiersema, Barrie, Greuter, D.Hawksw., Herend., S.Knapp, Kusber, D.Z.Li, Marhold, T.W.May, McNeill, A.M.Monro, J.Prado, M.J.Price & Gideon F.Sm.

nomenclaturalTitle in loaded entity:
Turland, Wiersema, Barrie, Greuter, D.Hawksw., Herend., S.Knapp, Kusber, D.Z.Li, Marhold, T.W.May, McNeill, Monro, A.M., J.Prado, M.J.Price & Gideon F.Sm.

The Team entity is loaded as part of the object graph which belongs to the reference. The submitter has no UPDATE permission for this Team. But saving the Reference will cause the Team being flushed to the data base. However the getter has changed the value of the nomenclaturalTitle-field and the user is required to have the UPDATE permission and a PermissionDeniedException is thrown.

One could now point out that the Team in in an inconsistent state since the nomenclaturalTitle differs from the value generated by the cache even if the protectedNomenclaturalTitleCache value is is false. But is seems as if this Team has been created by user henning manually using the Taxeditor (last updated on 2018-04-24 16:52:32). So this is not an import issue.

Either the Taxeditor must never leave Teams in such an inconsistent state or we need to find a way do deal with these situations in the entity class and/or during the flush operation.

This is really critical since it blocks underprivileged users from using object without having the UPDPATE permission.

agents.ods (13.4 KB) Andreas Kohlbecker, 10/26/2018 02:19 PM


Related issues

Copied from Edit - bug #7870: RegistrationWorkingsetEditor: Intenral error on clicking "new name" Closed 10/26/2018

Associated revisions

Revision cfcf723b (diff)
Added by Andreas Kohlbecker 3 months ago

fix #7874 updating also the nomenclaturalTitle in updateTitleCacheForSingleEntity()

History

#1 Updated by Andreas Kohlbecker 3 months ago

  • Copied from bug #7870: RegistrationWorkingsetEditor: Intenral error on clicking "new name" added

#2 Updated by Andreas Kohlbecker 3 months ago

AM:

ganz so kritisch ist es glaube ich nicht. Letztlich muss man nur den cache updaten mit dem Cacheupdater. Allerdings sollte man sich dabei vorher ganz sicher sein, dass auch alle Daten, die NICHT protected sind richtig atomisiert vorliegen.
Das Problem kommt durch die Umstellung der TitleCaches auf Initials hinter dem Namen. Da die notTitles auch mit dem TitleCache gefüllt werden, wenn keine expliziten nomTitles vorliegen, werden die damit auch geändert.
Eigentlich soll auf allen DBs früher oder später der Cacheupdater laufen. ABER: zumindest von Palmweb weiß ich, dass es da noch Daten gibt, die nicht protected sind und auch nicht atomisiert. Deswegen habe ich das noch verschoben, bis ich Zeit habe, die Daten vorher kurz zu checken.
Wie gesagt, wenn ihr euch bei Phycobank sicher seid, dass alles stimmt, sollte es kein Problem sein.
Ansonsten müssen wir eben möglichst bals mal an das Cache Handling bzgl. Permissions ran wie kürzlich besprochen (mit System Rechten und so)

#3 Updated by Andreas Kohlbecker 3 months ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker

#4 Updated by Andreas Kohlbecker 3 months ago

The Problem comes from the Person named "A.M. Monroe" which has been entered in the Taxeditor by Henning on 2018-04-24.
He was sure that he set the protectedNomenclaturalTile to FALSE before saving the entity. But the protected flags in the DB are all NULL (see agents.ods). I would expect these field to be filled or is NULL the same as FALSE in the sense of the cdm protected-Flags?

#5 Updated by Andreas Müller 3 months ago

Andreas Kohlbecker wrote:

The Problem comes from the Person named "A.M. Monroe" which has been entered in the Taxeditor by Henning on 2018-04-24.
He was sure that he set the protectedNomenclaturalTile to FALSE before saving the entity. But the protected flags in the DB are all NULL (see agents.ods). I would expect these field to be filled or is NULL the same as FALSE in the sense of the cdm protected-Flags?

Persons do not have a protected flag on this field. Only teams.

#6 Updated by Andreas Kohlbecker 3 months ago

Running the CacheUpdater should fix the issue. But the method IdentifiableServiceBase.updateTitleCacheForSingleEntity() misses updating the nomenclaturalTitle.

#7 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#8 Updated by Andreas Kohlbecker 3 months ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

please review

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)