Project

General

Profile

Actions

bug #8849

closed

NPE in synonym DetailsViewer for synonyms without accepted taxon

Added by Katja Luther about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Highest
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:

Description

if a synonym has no accepted taxon an exception appears.

in DetailsViewerE4.createTaxonSections():

        Taxon acceptedTaxon = null;
        if (taxonBase instanceof Taxon){
            acceptedTaxon = (Taxon)taxonBase;
        }else{
           acceptedTaxon = ((Synonym)taxonBase).getAcceptedTaxon();
        }
        Set<TaxonNode> nodes = acceptedTaxon.getTaxonNodes();
        // check for subtree permissions as well.
        if (hasPermission){
            for (TaxonNode node: nodes){
                hasPermission &= CdmStore.currentAuthentiationHasPermission(node, requiredCrud);
                if (!hasPermission){
                    //check whether there are explicit TaxonNode rights
                    boolean taxonnodePermissionExists = false;
                    Collection<? extends GrantedAuthority> authorities = CdmStore.getCurrentAuthentiation().getAuthorities();
                    for (GrantedAuthority grantedAuthority: authorities){
                        if (grantedAuthority.getAuthority().startsWith("TAXONNODE")){
                            taxonnodePermissionExists = true;
                        }
                    }
                    if (!taxonnodePermissionExists){
                        hasPermission = true;
                    }
                }
            }
        }

Das sollte abgefangen werden. Allerdings ist die Frage, wie wir dann mit der Permission umgehen (nur für diese wird ja das akzeptierte Taxon benötigt.
Da es sich um einen sehr großen Ausnahmefall handelt, der aber vorkommen kann (auch im Taxon Bulkeditor kann ich Synonyme ohne akzeptiertes Taxon erzeugen), fände ich es nicht schlimm dort einfach zu sagen, wenn ein reines Synonym ohne acc vorliegt, ist der Subtree Filter unrelevant und man bekommt die Permission.
Aber vielleicht habt ihr ja eine bessere Idee. Ich hab da gerade nicht die Zeit drüber nachzudenken.


Related issues

Copied to EDIT - bug #9083: Improve authorization handling in synonym details view (and generally)NewKatja Luther

Actions
Actions

Also available in: Atom PDF