|
Author: adrianc
Date: Wed Dec 30 22:46:27 2009 New Revision: 894729 URL: http://svn.apache.org/viewvc?rev=894729&view=rev Log: 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. Modified: ofbiz/branches/executioncontext20090812/applications/securityext/data/UserDemoData.xml ofbiz/branches/executioncontext20090812/framework/example/data/ExampleSecurityData.xml ofbiz/branches/executioncontext20090812/framework/example/servicedef/services.xml ofbiz/branches/executioncontext20090812/framework/example/widget/example/CommonScreens.xml ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleAjaxScreens.xml ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureScreens.xml ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml ofbiz/branches/executioncontext20090812/framework/example/widget/example/FormWidgetExampleScreens.xml Modified: ofbiz/branches/executioncontext20090812/applications/securityext/data/UserDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/securityext/data/UserDemoData.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/applications/securityext/data/UserDemoData.xml (original) +++ ofbiz/branches/executioncontext20090812/applications/securityext/data/UserDemoData.xml Wed Dec 30 22:46:27 2009 @@ -96,4 +96,5 @@ <UserToUserGroupRel userLoginId="ltdadmin1" groupId="OFBIZ_USERS"/> <UserToUserGroupRel userLoginId="bizadmin" groupId="OFBIZ_USERS"/> + <UserToArtifactPermRel userLoginId="admin" artifactPath="ofbiz" permissionValue="admin=true"/> </entity-engine-xml> Modified: ofbiz/branches/executioncontext20090812/framework/example/data/ExampleSecurityData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/data/ExampleSecurityData.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/data/ExampleSecurityData.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/data/ExampleSecurityData.xml Wed Dec 30 22:46:27 2009 @@ -48,7 +48,7 @@ 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> Modified: ofbiz/branches/executioncontext20090812/framework/example/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/servicedef/services.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/servicedef/services.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/servicedef/services.xml Wed Dec 30 22:46:27 2009 @@ -27,7 +27,7 @@ <!-- 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 @@ </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 @@ <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 @@ </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> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/CommonScreens.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/CommonScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/CommonScreens.xml Wed Dec 30 22:46:27 2009 @@ -70,10 +70,7 @@ <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 @@ </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 @@ </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 @@ <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 @@ </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 @@ </section> <decorator-section-include name="body"/> </widgets> - <fail-widgets> - <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label> - </fail-widgets> </section> </decorator-section> </decorator-screen> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleAjaxScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleAjaxScreens.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleAjaxScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleAjaxScreens.xml Wed Dec 30 22:46:27 2009 @@ -33,9 +33,6 @@ <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 @@ <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 @@ <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 @@ <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"/> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureScreens.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureScreens.xml Wed Dec 30 22:46:27 2009 @@ -33,9 +33,6 @@ <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 @@ </decorator-section> </decorator-screen> </widgets> - <fail-widgets> - <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label> - </fail-widgets> </section> </decorator-section> </decorator-screen> @@ -97,9 +91,6 @@ <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 @@ <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"> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml Wed Dec 30 22:46:27 2009 @@ -33,9 +33,6 @@ <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 @@ </decorator-section> </decorator-screen> </widgets> - <fail-widgets> - <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label> - </fail-widgets> </section> </decorator-section> </decorator-screen> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/FormWidgetExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/FormWidgetExampleScreens.xml?rev=894729&r1=894728&r2=894729&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/FormWidgetExampleScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/FormWidgetExampleScreens.xml Wed Dec 30 22:46:27 2009 @@ -30,9 +30,6 @@ <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 @@ <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> |
| Free forum by Nabble | Edit this page |
