first bits for #3097 (disable editors if a user has insufficient grants for a taxon...
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Wed, 12 Sep 2012 11:33:52 +0000 (11:33 +0000)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Wed, 12 Sep 2012 11:33:52 +0000 (11:33 +0000)
14 files changed:
.gitattributes
.gitignore
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/IMultiPageTaxonEditorPage.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Resources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/RequiredPermissions.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java

index 7c4e0033f6ab7ab79d8838605b68cceca7def64a..64a73a9f422dbd751e3be70a00264ecc3968d205 100644 (file)
@@ -1205,6 +1205,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/men
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/TaxonRelationshipTypeMenuPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/RequiredPermissions.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/ContextManager.java -text
index 71532edf7732609b6990994a576be5adab2b21b9..202b0a5024f54e735f1688ad103ea12ae637f54b 100644 (file)
@@ -3,6 +3,7 @@ eu.etaxonomy.taxeditor.application/.settings
 eu.etaxonomy.taxeditor.application/target
 eu.etaxonomy.taxeditor.bulkeditor/.settings
 eu.etaxonomy.taxeditor.bulkeditor/target
+eu.etaxonomy.taxeditor.cdmlib/.directory
 eu.etaxonomy.taxeditor.cdmlib/.settings
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.jar
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.zip
index 5551635cd04a31d8ea2d92d2ec3ed88133eee35e..415e6524bfb9c8f886eeaba61c36887f3dcf787b 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT.jar"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/opencsv-1.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-3.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/postgresql-8.2-504.jdbc4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/opencsv-1.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/poi-3.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/postgresql-8.2-504.jdbc4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar" sourcepath="/home/andreas/.m2/repository/org/springframework/security/spring-security-core/3.0.5.RELEASE/spring-security-core-3.0.5.RELEASE-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
index 213d960c1b3f1d31fd7dae076fa88df440733d02..eec66e1dd09d324fe6965ad62af4ba13db65b039 100644 (file)
@@ -383,6 +383,7 @@ Export-Package: com.google.api,
    org.hibernate.type,
    org.hibernate.event,
    eu.etaxonomy.cdm.model.common",
+ eu.etaxonomy.cdm.persistence.hibernate.permission,
  eu.etaxonomy.cdm.persistence.query;uses:="org.hibernate,org.hibernate.envers.query,org.hibernate.criterion",
  eu.etaxonomy.cdm.print,
  eu.etaxonomy.cdm.print.out,
index b243adfdd15642037e7f8ff6c622882796f153d7..5f7e9d6f6e165ad13fb6a0ca4eccaf4dc66d46f5 100644 (file)
@@ -45,14 +45,23 @@ public interface IMultiPageTaxonEditorPage extends IEditorPart {
        public boolean isRedrawing();
 
        /**
+        * Sets the editor page into enabled or disabled state depending on the 
+        * value of the supplied parameter <code>enabled</code>.
         * 
         * @param enabled
         */
        public void setEnabled(boolean enabled);
 
        /**
-        * 
+        * Sets the editor page into disabled state and changes the 
+        * appearance accordingly. 
         */
        void setDisabled();
        
+       /**
+        * Sets the editor page into disabled state and changes the 
+        * appearance in order to indicate that an error has occurred.  
+        */
+       public void setOnError();
+       
 }
index c348d5c343c3d9600b9256a4ffb4cb91c1923cd4..405820023da87c67cf9e94d527fd22f7ff862df6 100644 (file)
@@ -152,15 +152,19 @@ public class MultiPageTaxonEditor extends FormEditor implements
                                                        getClass(),
                                                        "An error occurred while saving the editor. Please close and reopen the taxon again.",
                                                        e);
-                       disableEditor();
+                       disableEditor(true);
                } finally {
                        monitor.done();
                }
        }
 
-       private void disableEditor() {
+       private void disableEditor(boolean isOnError) {
                for (IMultiPageTaxonEditorPage editorPage : getPages()) {
-                       editorPage.setDisabled();
+                       if(isOnError){
+                               editorPage.setOnError();
+                       }else {
+                               editorPage.setDisabled();                               
+                       }
                }
                conversation.unregisterForDataStoreChanges(this);
                conversation.close();
index 951dbcae6df3b417bec14bf5ec71835cd20b3b9a..9700d00cee042f2312b099d4716f22563eac8765 100644 (file)
@@ -51,6 +51,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
@@ -72,6 +73,9 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.security.RequiredPermissions;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>
@@ -273,6 +277,13 @@ public class TaxonNameEditor extends EditorPart implements
                                        "There should always be a selected object.");
                }
                getSelectedContainer().setSelected();
+               
+               // check permissions
+               TaxonNode taxonNode = ((TaxonEditorInput)getEditorInput()).getTaxonNode();
+               boolean doEnable = CdmStore.currentAuthentiationHasPermission(taxonNode, RequiredPermissions.TAXONNODE_EDIT);
+               if(!doEnable){
+                       setDisabled();
+               }
        }
 
        /** {@inheritDoc} */
@@ -494,6 +505,7 @@ public class TaxonNameEditor extends EditorPart implements
                getSite().setSelectionProvider(simpleSelectionProvider);
        }
 
+
        /**
         * 
         */
@@ -592,7 +604,7 @@ public class TaxonNameEditor extends EditorPart implements
 
                allGroups.add(getAcceptedGroup());
 
-               List<HomotypicalSynonymGroup> grps = getHeterotypicSynonymGroups();
+//             List<HomotypicalSynonymGroup> grps = getHeterotypicSynonymGroups(); // UNUSED => remove
                
                heterotypicSynonymGroups = getHeterotypicSynonymGroups();
                
@@ -871,21 +883,33 @@ public class TaxonNameEditor extends EditorPart implements
                }
                return getAcceptedNameContainer();
        }
+       
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#setOnError()
+        */
+       public void setOnError() {
+               Color disabledColor =  StoreUtil.getColor(Resources.COLOR_EDITOR_ERROR);
+               setDisabled(disabledColor);
+       }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#setDisabled()
+        */
        @Override
        public void setDisabled(){
+               Color disabledColor =  StoreUtil.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
+               setDisabled(disabledColor);
+       }
+       
+       protected void setDisabled(Color disabledColor) {
+       
                for(AbstractGroupedContainer groupedContainer : getGroupedContainers()){
                        groupedContainer.setDisabled(true);
                }
                
-               // send an empty selection to the current provider
+               // send an empty selection to the current provider - TODO only on error ???
                getManagedForm().setInput(null);
                
-               // coloring the widgets
-               
-               // TODO move this to resources and make configurable via Preferences
-               Color disabledColor = Display.getDefault().getSystemColor(SWT.COLOR_RED);
-               
                for(AbstractGroupedContainer groupedContainer : getGroupedContainers()){
                        groupedContainer.setBackground(disabledColor);
                }
@@ -894,6 +918,7 @@ public class TaxonNameEditor extends EditorPart implements
        
        @Override
        public void setEnabled(boolean enabled) {
+               //FIXME this method seems incomplete
                for(AbstractGroupedContainer groupedContainer : getGroupedContainers()){
                        groupedContainer.setEnabled(getManagedForm().setInput(selection));
                }
index 23d6ec0460fab915650a0f49d870444d92686600..5fbed53059c8fd4d0dacf2bd8d805cad3f200091 100644 (file)
@@ -634,7 +634,7 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                focusListener = new FocusAdapter() {
                        @Override
                        public void focusGained(FocusEvent e) {
-                               if(disabled){
+                               if(!enabled){
                                        return;
                                }
                                for (AbstractGroupedContainer container : getEditor()
@@ -1011,8 +1011,6 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
 
        private boolean enabled;
 
-       private boolean disabled;
-
        /**
         * nonEditableInfo is a label displayed underneath a GroupedComposite's
         * input field. For instance, NameComposites display things like name
@@ -1244,8 +1242,8 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
        }
        
        public void setDisabled(boolean disabled) {
-               this.disabled = disabled;
-               setEnabled(disabled);
+               this.enabled = !disabled;
+               setEnabled(enabled);
        }
        
        public void setEnabled(boolean enabled) {
@@ -1253,10 +1251,11 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                Color color = enabled ? control.getForeground() : EditorUtil.getColor(Resources.COLOR_DISABLED_EDITOR);
                                
                getNameViewer().getTextWidget().setEditable(enabled);
+               getNameViewer().getTextWidget().setEnabled(enabled);
                getNameViewer().getTextWidget().setForeground(color);
        }
        
-       public boolean getEnabled(){
+       public boolean isEnabled(){
                return enabled;
        }
 }
index d0a823f4d0c5398b5958c2b0ee2704c04653b1ce..7774c2c1eebeff4086c797b983bc926214b95948 100644 (file)
@@ -15,15 +15,24 @@ import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.StyledString;
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.TextStyle;
 import org.eclipse.ui.navigator.IDescriptionProvider;
 import org.hibernate.LazyInitializationException;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.security.RequiredPermissions;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>TaxonNodeLabelProvider class.</p>
@@ -35,6 +44,9 @@ import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 public class TaxonNodeLabelProvider extends ColumnLabelProvider 
                implements ILabelProvider, IDescriptionProvider, IStyledLabelProvider {
        
+
+       private Styler notGrantedStyler = null;
+       
        /** {@inheritDoc} */
        @Override
        public Image getImage(Object element) {
@@ -84,6 +96,28 @@ public class TaxonNodeLabelProvider extends ColumnLabelProvider
         */
        /** {@inheritDoc} */
        public StyledString getStyledText(Object element) {
-               return new StyledString(getText(element));
+               // determine style base on  user grants
+               Styler styler = null;
+               if(!CdmStore.currentAuthentiationHasPermission((CdmBase)element, RequiredPermissions.TAXONNODE_EDIT)){
+                       styler = getNotGrantedStyler();
+               }
+               return new StyledString(getText(element), styler);
+               
+       }
+       
+       /**
+        * @return
+        */
+       private Styler getNotGrantedStyler() {
+               if (notGrantedStyler  == null) {
+                       notGrantedStyler = new Styler() {
+                               @Override
+                               public void applyStyles(TextStyle textStyle) {
+                                       textStyle.underline = false;
+                                       textStyle.foreground = StoreUtil.getColor(Resources.COLOR_TEXT_DISABLED);
+                               }
+                       };
+               }
+               return notGrantedStyler;
        }
 }
index 4462122ea75823fc91391159b423adac56ec41ef..fabb883536c051d0ae62be3b6c83758726b91169 100644 (file)
@@ -24,6 +24,7 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.preference.matching,
  eu.etaxonomy.taxeditor.preference.menu,
  eu.etaxonomy.taxeditor.preference.wizard,
+ eu.etaxonomy.taxeditor.security,
  eu.etaxonomy.taxeditor.store,
  eu.etaxonomy.taxeditor.store.internal,
  eu.etaxonomy.taxeditor.store.operations,
index c9cc810b911be2924812c8e4ec0639c0df5da371..70457a9f33f39441b666ba77944cc91e70d64937 100644 (file)
             label="Disabled Name Editor Field"
             value="105,114,124">
       </colorDefinition>
+      <colorDefinition
+            categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
+            id="eu.etaxonomy.taxeditor.preferences.colorDefinition.editorError"
+            label="Editor On Error"
+            value="255,0,0">
+      </colorDefinition>
       </extension>
 <extension
       point="org.eclipse.core.expressions.propertyTesters">
index 11f0948fad91aea12bf830d08363e58007a1045f..658abe1e94c5a0c91e4b3b6750d32100296d565a 100644 (file)
@@ -81,5 +81,7 @@ public interface Resources {
        
        public static final String COLOR_DISABLED_EDITOR = "eu.etaxonomy.taxeditor.preferences.colorDefinition.disabledEditor";
        
+       public static final String COLOR_EDITOR_ERROR = "eu.etaxonomy.taxeditor.preferences.colorDefinition.editorError";
+       
        
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/RequiredPermissions.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/RequiredPermissions.java
new file mode 100644 (file)
index 0000000..a49390b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.security;
+
+import java.util.EnumSet;
+
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
+
+/**
+ * Provides the required permissions a user would need in order to view or edit a 
+ * specific cdm type.
+ * 
+ * @author andreas kohlbecker
+ *
+ */
+public class RequiredPermissions {
+       
+       public static final EnumSet<CRUD> TAXONNODE_EDIT = Operation.UPDATE;
+       
+       public static final EnumSet<CRUD> TAXON_EDIT = Operation.UPDATE;
+       
+       public static final EnumSet<CRUD> DESCRIPTION_EDIT = Operation.UPDATE;
+       
+
+}
index fcada2099860383358d86be1ffb73b30a5041538..5b9ed355d90dd4d8018fd98463bdfcc694d2a752 100644 (file)
@@ -12,13 +12,17 @@ package eu.etaxonomy.taxeditor.store;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.util.EnumSet;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
+import org.springframework.security.access.PermissionEvaluator;
 import org.springframework.security.authentication.ProviderManager;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
@@ -27,7 +31,10 @@ import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.io.ExportManager;
 import eu.etaxonomy.taxeditor.io.ImportManager;
@@ -289,6 +296,18 @@ public class CdmStore {
        public static ProviderManager getAuthenticationManager() {
                return getCurrentApplicationConfiguration().getAuthenticationManager();
        }
+       
+       /**
+        * <p>
+        * getAuthenticationManager
+        * </p>
+        * 
+        * @return a
+        *         {@link PermissionEvaluator} object.
+        */
+       public static PermissionEvaluator getPermissionEvaluator() {
+               return getCurrentApplicationConfiguration().getPermissionEvaluator();
+       }
 
        /**
         * <p>
@@ -301,6 +320,23 @@ public class CdmStore {
                return (IEditGeoService) getCurrentApplicationConfiguration().getBean(
                                "editGeoService");
        }
+       
+       /*
+        * SECURITY RELATED CONVENIENCE METHODS
+        */
+       
+       /**
+        * @see org.springframework.security.access.PermissionEvaluator#hasPermission(org.springframework.security.core.Authentication, java.lang.Object, java.lang.Object)
+     *
+        * @param targetDomainObject
+        * @param permission 
+        * @return
+        */
+       public static boolean currentAuthentiationHasPermission(CdmBase targetDomainObject, EnumSet<CRUD> permission){
+               //TODO use getCurrentApplicationConfiguration().currentAuthentiationHasPermission(CdmBase targetDomainObject, Operation permission) instead
+               SecurityContext context = SecurityContextHolder.getContext();
+               return getPermissionEvaluator().hasPermission(context.getAuthentication(), targetDomainObject, permission);
+       }
 
        /*
         * LANGUAGE