Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Converted Example component to security-aware artifacts.

The Find Example screen search results aren't working, and I'm not sure why. Reverting to the old-style security doesn't fix it. I think it is time to create a new branch and get this synchronized with the trunk again.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/executioncontext20090812@894729 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit b6dbe580ed12604852935c557941b2f8636ea6e6 1 parent 0d4fdf9
@adrian-crum adrian-crum authored
View
1  applications/securityext/data/UserDemoData.xml
@@ -96,4 +96,5 @@ under the License.
<UserToUserGroupRel userLoginId="ltdadmin1" groupId="OFBIZ_USERS"/>
<UserToUserGroupRel userLoginId="bizadmin" groupId="OFBIZ_USERS"/>
+ <UserToArtifactPermRel userLoginId="admin" artifactPath="ofbiz" permissionValue="admin=true"/>
</entity-engine-xml>
View
2  framework/example/data/ExampleSecurityData.xml
@@ -48,7 +48,7 @@ under the License.
is converted over to the new security design, the corresponding admin
permission should be removed. -->
- <UserGrpToArtifactPermRel groupId="OFBIZ_USERS" artifactPath="ofbiz/example" permissionValue="admin=true"/>
+<!-- <UserGrpToArtifactPermRel groupId="OFBIZ_USERS" artifactPath="ofbiz/example" permissionValue="admin=true"/> -->
<UserGrpToArtifactPermRel groupId="OFBIZ_USERS" artifactPath="ofbiz/exampleext" permissionValue="admin=true"/>
</entity-engine-xml>
View
26 framework/example/servicedef/services.xml
@@ -27,7 +27,7 @@ under the License.
<!-- Example & Related Services -->
<service name="createExample" default-entity-name="Example" engine="entity-auto" invoke="create" auth="true">
<description>Create a Example</description>
- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/> -->
<auto-attributes include="pk" mode="OUT" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
<override name="exampleTypeId" optional="false"/>
@@ -36,20 +36,20 @@ under the License.
</service>
<service name="updateExample" default-entity-name="Example" engine="entity-auto" invoke="update" auth="true">
<description>Update a Example</description>
- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
<attribute name="oldStatusId" type="String" mode="OUT" optional="false"/>
</service>
<service name="deleteExample" default-entity-name="Example" engine="entity-auto" invoke="delete" auth="true">
<description>Delete a Example</description>
- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
<service name="createExampleStatus" default-entity-name="ExampleStatus" engine="simple"
location="component://example/script/org/ofbiz/example/example/ExampleServices.xml" invoke="createExampleStatus" auth="true">
<description>Create a ExampleStatus</description>
- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/> -->
<auto-attributes include="all" mode="IN" optional="false">
<exclude field-name="statusDate"/>
<exclude field-name="statusEndDate"/>
@@ -58,7 +58,7 @@ under the License.
<service name="createExampleItem" default-entity-name="ExampleItem" engine="entity-auto" invoke="create" auth="true">
<description>Create a ExampleItem</description>
- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
<override name="exampleItemSeqId" mode="OUT"/> <!-- make this OUT rather than IN, we will automatically generate the next sub-sequence ID -->
@@ -66,52 +66,52 @@ under the License.
</service>
<service name="updateExampleItem" default-entity-name="ExampleItem" engine="entity-auto" invoke="update" auth="true">
<description>Update a ExampleItem</description>
- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="deleteExampleItem" default-entity-name="ExampleItem" engine="entity-auto" invoke="delete" auth="true">
<description>Delete a ExampleItem</description>
- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
<!-- ExampleFeature Services -->
<service name="createExampleFeature" default-entity-name="ExampleFeature" engine="entity-auto" invoke="create" auth="true">
<description>Create a ExampleFeature</description>
- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/> -->
<auto-attributes include="pk" mode="OUT" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
<override name="description" optional="false"/>
</service>
<service name="updateExampleFeature" default-entity-name="ExampleFeature" engine="entity-auto" invoke="update" auth="true">
<description>Update a ExampleFeature</description>
- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="deleteExampleFeature" default-entity-name="ExampleFeature" engine="entity-auto" invoke="delete" auth="true">
<description>Delete a ExampleFeature</description>
- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
<service name="createExampleFeatureAppl" default-entity-name="ExampleFeatureAppl" engine="entity-auto" invoke="create" auth="true">
<description>Create a ExampleFeatureAppl</description>
- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="CREATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
<override name="fromDate" optional="true"/>
</service>
<service name="updateExampleFeatureAppl" default-entity-name="ExampleFeatureAppl" engine="entity-auto" invoke="update" auth="true">
<description>Update a ExampleFeatureAppl</description>
- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="UPDATE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="deleteExampleFeatureAppl" default-entity-name="ExampleFeatureAppl" engine="entity-auto" invoke="delete" auth="true">
<description>Delete a ExampleFeatureAppl</description>
- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/>
+<!-- <permission-service service-name="exampleGenericPermission" main-action="DELETE"/> -->
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
View
24 framework/example/widget/example/CommonScreens.xml
@@ -70,10 +70,7 @@ under the License.
<decorator-section name="pre-body">
<section>
<condition>
- <and>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- <not><if-empty field="example"/></not>
- </and>
+ <not><if-empty field="example"/></not>
</condition>
<widgets>
<include-menu name="EditExample" location="component://example/widget/example/ExampleMenus.xml"/>
@@ -82,10 +79,6 @@ under the License.
</decorator-section>
<decorator-section name="body">
<section>
- <!-- do check for EXAMPLE, _VIEW permission -->
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<section>
<condition>
@@ -112,9 +105,6 @@ under the License.
</section>
<decorator-section-include name="body"/>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
@@ -134,10 +124,7 @@ under the License.
<decorator-section name="pre-body">
<section>
<condition>
- <and>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- <not><if-empty field="exampleFeature"/></not>
- </and>
+ <not><if-empty field="exampleFeature"/></not>
</condition>
<widgets>
<include-menu name="EditExampleFeature" location="component://example/widget/example/ExampleMenus.xml"/>
@@ -146,10 +133,6 @@ under the License.
</decorator-section>
<decorator-section name="body">
<section>
- <!-- do check for EXAMPLE, _VIEW permission -->
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<section>
<condition>
@@ -169,9 +152,6 @@ under the License.
</section>
<decorator-section-include name="body"/>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
View
12 framework/example/widget/example/ExampleAjaxScreens.xml
@@ -33,9 +33,6 @@ under the License.
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<container style="h1"><label>${uiLabelMap[titleProperty]}</label></container>
<section>
@@ -55,9 +52,6 @@ under the License.
<include-screen name="CreateExampleFormOnly"/>
</container>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
@@ -67,9 +61,6 @@ under the License.
<screen name="ListExampleFormOnly">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<actions>
<!-- NOTE: these are needed because this may be run as a top level screen and would have no decorator -->
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
@@ -83,9 +74,6 @@ under the License.
<screen name="CreateExampleFormOnly">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<actions>
<!-- these are only needed so that when bsh evaluates use-when attributes these will exist and not cause an error -->
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
View
10 framework/example/widget/example/ExampleFeatureScreens.xml
@@ -33,9 +33,6 @@ under the License.
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="menu-bar">
@@ -49,9 +46,6 @@ under the License.
</decorator-section>
</decorator-screen>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
@@ -97,9 +91,6 @@ under the License.
<screen name="LookupExampleFeature">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<actions>
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
<set field="title" value="${uiLabelMap.PageTitleLookupExampleFeature}"/>
@@ -107,7 +98,6 @@ under the License.
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="10"/>
</actions>
-
<widgets>
<decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="search-options">
View
6 framework/example/widget/example/ExampleScreens.xml
@@ -33,9 +33,6 @@ under the License.
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<!-- Uncomment this section to see the ExecutionContext in action
<container style="button-bar"><label text="Execution path for this screen: ${executionContext}"/></container>
@@ -53,9 +50,6 @@ under the License.
</decorator-section>
</decorator-screen>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
View
6 framework/example/widget/example/FormWidgetExampleScreens.xml
@@ -30,9 +30,6 @@ under the License.
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
- <condition>
- <if-has-permission permission="EXAMPLE" action="_VIEW"/>
- </condition>
<widgets>
<container style="h1"><label>${uiLabelMap.PageTitleFormWidgetExamples}</label></container>
<container style="screenlet-body">
@@ -70,9 +67,6 @@ under the License.
<include-form name="FOPFontsExampleForm" location="component://example/widget/example/FormWidgetExampleForms.xml"/>
</container>
</widgets>
- <fail-widgets>
- <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
- </fail-widgets>
</section>
</decorator-section>
</decorator-screen>
Please sign in to comment.
Something went wrong with that request. Please try again.