Author: adrianc
Date: Mon Sep 17 13:43:47 2007
New Revision: 576581
URL: http://svn.apache.org/viewvc?rev=576581&view=rev
Log:
More Asset Maint permissions work, plus some screen widget code cleanup.
Modified:
ofbiz/trunk/specialpurpose/assetmaint/ofbiz-component.xml
ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml
ofbiz/trunk/specialpurpose/assetmaint/widget/FacilityScreens.xml
Modified: ofbiz/trunk/specialpurpose/assetmaint/ofbiz-component.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/ofbiz-component.xml?rev=576581&r1=576580&r2=576581&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/ofbiz-component.xml Mon Sep 17
13:43:47 2007
@@ -34,6 +34,7 @@
<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main"
location="entitydef/entitymodel.xml"/>
<entity-resource type="group" reader-name="main" loader="main"
location="entitydef/entitygroup.xml"/>
+ <entity-resource type="data" reader-name="seed" loader="main"
location="data/AssetMaintSecurityData.xml"/>
<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main"
location="servicedef/services.xml"/>
Modified:
ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml?rev=576581&r1=576580&r2=576581&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
(original)
+++
ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
Mon Sep 17 13:43:47 2007
@@ -71,22 +71,9 @@
<!-- ==============Permission Checking Service============= -->
<simple-method method-name="assetMaintPermissionCheck"
short-description="Asset Maintenance permission logic">
- <if-has-permission permission="ASSETMAINT_ADMIN">
- <set field="hasPermission" type="Boolean" value="true"/>
- <else>
- <if-has-permission permission="ASSETMAINT"
action="_${parameters.mainAction}">
- <set field="hasPermission" type="Boolean" value="true"/>
- <else>
- <set field="hasPermission" type="Boolean"
value="false"/>
- <set field="failMessage" value="Security Error: you
must have one of the following permissions:
- ACCOUNTING_${parameters.mainAction},
ACCOUNTING_ROLE_${parameters.mainAction}, ACCOUNTING_ADMIN,
ASSETMAINT_${parameters.mainAction}, ASSETMAINT_ADMIN"/>
- <field-to-result field-name="failMessage"/>
- </else>
- </if-has-permission>
- </else>
- </if-has-permission>
- <field-to-result field-name="hasPermission"/>
+ <set field="primaryPermission" value="ASSETMAINT"/>
+ <call-simple-method method-name="genericBasePermissionCheck"
xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
</simple-method>
</simple-methods>
-
+
Modified: ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml?rev=576581&r1=576580&r2=576581&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml Mon Sep 17
13:43:47 2007
@@ -22,9 +22,14 @@
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- ECAs used to extend service permission checking -->
- <eca service="fixedAssetPermissionCheck" event="return"
run-on-failure="true" run-on-error="true">
+ <eca service="fixedAssetPermissionCheck" event="return"
run-on-failure="true">
<condition field-name="hasPermission" operator="equals" value="false"
type="Boolean"/>
- <action service="assetMaintPermissionCheck" mode="sync"/>
+ <action service="assetMaintPermissionCheck" mode="sync"
ignore-failure="false"/>
+ </eca>
+
+ <eca service="facilityGenericPermission" event="return"
run-on-failure="true">
+ <condition field-name="hasPermission" operator="equals" value="false"
type="Boolean"/>
+ <action service="assetMaintPermissionCheck" mode="sync"
ignore-failure="false"/>
</eca>
</service-eca>
Modified: ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml?rev=576581&r1=576580&r2=576581&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml Mon Sep 17
13:43:47 2007
@@ -86,9 +86,11 @@
<decorator-screen name="main-decorator">
<decorator-section name="body">
<section>
- <!-- TODO: do check for ASSETMAINT, _VIEW
permission -->
<condition>
- <if-has-permission permission="OFBTOOLS"
action="_VIEW"/>
+ <or>
+ <if-has-permission permission="ASSETMAINT"
action="_VIEW"/>
+ <if-has-permission
permission="ASSETMAINT_ADMIN"/>
+ </or>
</condition>
<widgets>
<section>
@@ -101,12 +103,12 @@
<label style="head1"
text="${uiLabelMap.${labelTitleProperty}}"/>
</fail-widgets>
</section>
+ <decorator-section-include name="body"/>
</widgets>
<fail-widgets>
- <label style="head3"
text="${uiLabelMap.AcccountingViewPermissionError}"/>
+ <label style="head3"
text="${uiLabelMap.AssetMaintViewPermissionError}"/>
</fail-widgets>
</section>
- <decorator-section-include name="body"/>
</decorator-section>
</decorator-screen>
</widgets>
@@ -122,9 +124,11 @@
<decorator-screen name="main-decorator">
<decorator-section name="body">
<section>
- <!-- TODO: do check for ACCOUNTING, WORKEFFORT,
ASSETMAINT, _VIEW permission -->
<condition>
- <if-has-permission permission="OFBTOOLS"
action="_VIEW"/>
+ <or>
+ <if-has-permission permission="ASSETMAINT"
action="_VIEW"/>
+ <if-has-permission
permission="ASSETMAINT_ADMIN"/>
+ </or>
</condition>
<widgets>
<section>
@@ -137,12 +141,12 @@
<label style="head1"
text="${uiLabelMap.${labelTitleProperty}}"/>
</fail-widgets>
</section>
+ <decorator-section-include name="body"/>
</widgets>
<fail-widgets>
- <label style="head3"
text="${uiLabelMap.AcccountingViewPermissionError}"/>
+ <label style="head3"
text="${uiLabelMap.AssetMaintViewPermissionError}"/>
</fail-widgets>
</section>
- <decorator-section-include name="body"/>
</decorator-section>
</decorator-screen>
</widgets>
@@ -161,7 +165,10 @@
<decorator-section name="body">
<section>
<condition>
- <if-has-permission permission="FACILITY"
action="_VIEW"/>
+ <or>
+ <if-has-permission permission="ASSETMAINT"
action="_VIEW"/>
+ <if-has-permission
permission="ASSETMAINT_ADMIN"/>
+ </or>
</condition>
<widgets>
<section>
@@ -181,7 +188,7 @@
</section>
</widgets>
<fail-widgets>
- <label
style="head3">${uiLabelMap.ProductFacilityViewPermissionError}</label>
+ <label
style="head3">${uiLabelMap.AssetMaintViewPermissionError}</label>
</fail-widgets>
</section>
</decorator-section>
@@ -190,4 +197,4 @@
</section>
</screen>
</screens>
-
\ No newline at end of file
+
Modified: ofbiz/trunk/specialpurpose/assetmaint/widget/FacilityScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/widget/FacilityScreens.xml?rev=576581&r1=576580&r2=576581&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/widget/FacilityScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/widget/FacilityScreens.xml Mon Sep 17
13:43:47 2007
@@ -38,45 +38,6 @@
</widgets>
</section>
</screen>
- <screen name="CommonFacilityDecorator">
- <section>
- <actions>
- <set field="facilityId" from-field="parameters.facilityId"/>
- <entity-one entity-name="Facility" value-name="facility"/>
- </actions>
- <widgets>
- <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
- <decorator-section name="body">
- <section>
- <condition>
- <if-has-permission permission="FACILITY"
action="_VIEW"/>
- </condition>
- <widgets>
- <section>
- <condition>
- <or>
- <not><if-empty
field-name="facility"/></not>
- <not><if-empty
field-name="displayWithNoFacility"/></not>
- </or>
- </condition>
- <widgets>
- <include-menu name="FacilityTabBar"
location="component://assetmaint/widget/Menus.xml"/>
- <decorator-section-include
name="body"/>
- </widgets>
- <fail-widgets>
- <label
style="head3">${uiLabelMap.ProductErrorFacilityIdNotFound}</label>
- </fail-widgets>
- </section>
- </widgets>
- <fail-widgets>
- <label
style="head3">${uiLabelMap.ProductFacilityViewPermissionError}</label>
- </fail-widgets>
- </section>
- </decorator-section>
- </decorator-screen>
- </widgets>
- </section>
- </screen>
<screen name="ViewFacilityInventoryByProduct">
<section>
<actions>
@@ -102,7 +63,7 @@
<script
location="component://product/webapp/facility/WEB-INF/actions/facility/countFacilityInventoryByProduct.bsh"/>
</actions>
<widgets>
- <decorator-screen name="CommonFacilityDecorator">
+ <decorator-screen name="CommonFacilityDecorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<container>