Revision c56db927
Added by Katja Luther over 12 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/SaveOrUpdateEntityListener.java | ||
---|---|---|
54 | 54 |
TaxonNameBase taxonName = taxonNameDescription.getTaxonName(); |
55 | 55 |
permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), taxonName, CdmPermission.UPDATE); |
56 | 56 |
} else{ |
57 |
|
|
57 | 58 |
throw new EvaluationFailedException("Permission evaluation failed for " + event.getEntity()); |
58 | 59 |
} |
59 | 60 |
} |
... | ... | |
62 | 63 |
if (SecurityContextHolder.getContext().getAuthentication()!= null){ |
63 | 64 |
|
64 | 65 |
if (!permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), entity, CdmPermission.UPDATE)){ |
65 |
throw new EvaluationFailedException("Permission evaluation failed for " + event.getEntity()); |
|
66 |
if (entity instanceof SpecimenDescription){ |
|
67 |
//TODO |
|
68 |
}else if (entity instanceof TaxonDescription){ |
|
69 |
TaxonDescription taxonDescription = (TaxonDescription) entity; |
|
70 |
Taxon taxon = taxonDescription.getTaxon(); |
|
71 |
permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), taxon, CdmPermission.UPDATE); |
|
72 |
} else if (entity instanceof TaxonNameDescription){ |
|
73 |
TaxonNameDescription taxonNameDescription = (TaxonNameDescription) entity; |
|
74 |
TaxonNameBase taxonName = taxonNameDescription.getTaxonName(); |
|
75 |
permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), taxonName, CdmPermission.UPDATE); |
|
76 |
} else{ |
|
77 |
|
|
78 |
throw new EvaluationFailedException("Permission evaluation failed for " + event.getEntity()); |
|
79 |
} |
|
66 | 80 |
} |
67 | 81 |
} |
68 | 82 |
} |
Also available in: Unified diff