From 30d8e24db3b4f3f731237179ece149e31dd60f94 Mon Sep 17 00:00:00 2001 From: Andrew Zeneski Date: Wed, 10 Jan 2007 05:31:37 +0000 Subject: [PATCH] added examples of using new service based security; removed all security calls from the simple methods, added the security line to the definitions, implemented a generic simple permission example git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@494720 13f79535-47bb-0310-9956-ffa450edef68 --- .../example/config/ExampleUiLabels.properties | 2 +- .../example/ExamplePermissionServices.xml | 37 ++++++++++++++++ .../ofbiz/example/example/ExampleServices.xml | 28 +----------- framework/example/servicedef/services.xml | 43 +++++++++++++------ 4 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml diff --git a/framework/example/config/ExampleUiLabels.properties b/framework/example/config/ExampleUiLabels.properties index 21228f14ac..781a31b342 100644 --- a/framework/example/config/ExampleUiLabels.properties +++ b/framework/example/config/ExampleUiLabels.properties @@ -35,7 +35,7 @@ ExampleNewExample=New Example ExampleNewExampleFeature=New Example Feature ExampleErrorNoExampleStatusValidChange=Error\: status change from [${lookedUpValue.statusId}] to [${parameters.statusId}] is not allowed. -ExamplePermissionError=Security Error\: to run ${methodShortDescription} you must have the EXAMPLE${securityAction} or EXAMPLE_ADMIN permission +ExamplePermissionError=Security Error\: to run ${methodShortDescription} you must have the EXAMPLE_${mainAction} or EXAMPLE_ADMIN permission ExampleViewPermissionError=You do not have permission to view this page. ("EXAMPLE_VIEW" or "EXAMPLE_ADMIN" needed) ExampleWelcome=Welcome to the Example application! diff --git a/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml b/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml new file mode 100644 index 0000000000..3900508e28 --- /dev/null +++ b/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/example/script/org/ofbiz/example/example/ExampleServices.xml b/framework/example/script/org/ofbiz/example/example/ExampleServices.xml index b350a2800f..b9b21f37ca 100644 --- a/framework/example/script/org/ofbiz/example/example/ExampleServices.xml +++ b/framework/example/script/org/ofbiz/example/example/ExampleServices.xml @@ -19,10 +19,6 @@ under the License. xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd"> - - - - @@ -33,10 +29,6 @@ under the License. - - - - @@ -65,16 +57,10 @@ under the License. - - - - - - @@ -84,10 +70,6 @@ under the License. - - - - @@ -96,19 +78,11 @@ under the License. - - - - - - - - - + diff --git a/framework/example/servicedef/services.xml b/framework/example/servicedef/services.xml index 4437e65e16..4a85b41ca9 100644 --- a/framework/example/servicedef/services.xml +++ b/framework/example/servicedef/services.xml @@ -23,8 +23,9 @@ under the License. + location="org/ofbiz/example/example/ExampleServices.xml" invoke="createExample" auth="true"> Create a Example + @@ -32,81 +33,99 @@ under the License. + location="org/ofbiz/example/example/ExampleServices.xml" invoke="updateExample" auth="true"> Update a Example + + location="org/ofbiz/example/example/ExampleServices.xml" invoke="deleteExample" auth="true"> Delete a Example + + location="org/ofbiz/example/example/ExampleServices.xml" invoke="createExampleStatus" auth="true"> Create a ExampleStatus + + location="org/ofbiz/example/example/ExampleServices.xml" invoke="createExampleItem" auth="true"> Create a ExampleItem + + location="org/ofbiz/example/example/ExampleServices.xml" invoke="updateExampleItem" auth="true"> Update a ExampleItem + Delete a ExampleItem + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="createExampleFeature" auth="true"> Create a ExampleFeature + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="updateExampleFeature" auth="true"> Update a ExampleFeature + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="deleteExampleFeature" auth="true"> Delete a ExampleFeature + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="createExampleFeatureAppl" auth="true"> Create a ExampleFeatureAppl + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="updateExampleFeatureAppl" auth="true"> Update a ExampleFeatureAppl + + location="org/ofbiz/example/feature/ExampleFeatureServices.xml" invoke="deleteExampleFeatureAppl" auth="true"> Delete a ExampleFeatureAppl + + + + + +