Author: deepak
Date: Tue Oct 17 09:58:24 2017 New Revision: 1812381 URL: http://svn.apache.org/viewvc?rev=1812381&view=rev Log: Improved: Proper use of if-has-permission, Apply slightly modified patch from jira issue, if if-has-permission uses _ADMIN permission to check condition, so its good to have old pattern instead of using permission/action pattern. Thanks Suraj Khurana for your contribution(OFBIZ-9740) Modified: ofbiz/ofbiz-framework/trunk/applications/marketing/widget/sfa/SfaMenus.xml ofbiz/ofbiz-framework/trunk/applications/party/widget/partymgr/PartyMenus.xml ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/inventory/InventoryServices.xml ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ImageManagementScreens.xml ofbiz/ofbiz-framework/trunk/framework/webtools/widget/ArtifactInfoScreens.xml ofbiz/ofbiz-framework/trunk/framework/webtools/widget/LabelManagerScreens.xml Modified: ofbiz/ofbiz-framework/trunk/applications/marketing/widget/sfa/SfaMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/marketing/widget/sfa/SfaMenus.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/marketing/widget/sfa/SfaMenus.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/marketing/widget/sfa/SfaMenus.xml Tue Oct 17 09:58:24 2017 @@ -118,7 +118,7 @@ under the License. <menu-item name="newInternalNote" title="${uiLabelMap.PartyNewInternalNote}"> <condition> <and> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> <if-empty field="communicationEvent"/> </and> </condition> Modified: ofbiz/ofbiz-framework/trunk/applications/party/widget/partymgr/PartyMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/widget/partymgr/PartyMenus.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/party/widget/partymgr/PartyMenus.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/party/widget/partymgr/PartyMenus.xml Tue Oct 17 09:58:24 2017 @@ -337,7 +337,7 @@ <menu name="CommunicationsMenu"> <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"> <condition> - <if-has-permission permission="PARTYMGR_CME-EMAIL_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_CREATE"/> </condition> <link target="${parameters._LAST_VIEW_NAME_}"> <parameter param-name="communicationEventTypeId" value="EMAIL_COMMUNICATION"/> @@ -350,7 +350,7 @@ </menu-item> <menu-item name="newNote" title="${uiLabelMap.PartyNewInternalNote}"> <condition> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> </condition> <link target="${parameters._LAST_VIEW_NAME_}"> <parameter param-name="communicationEventTypeId" value="COMMENT_NOTE"/> @@ -390,7 +390,7 @@ <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"> <condition> <and> - <if-has-permission permission="PARTYMGR_CME-EMAIL_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_CREATE"/> <if-empty field="communicationEvent"/> </and> </condition> @@ -406,7 +406,7 @@ <menu-item name="newInternalNote" title="${uiLabelMap.PartyNewInternalNote}"> <condition> <and> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> <if-empty field="communicationEvent"/> </and> </condition> @@ -427,8 +427,8 @@ <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_UNKNOWN_PARTY"/> <if-compare field="communicationEvent.partyIdFrom" operator="not-equals" value="${partyId}"/> - <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> </and> </condition> <link target="${parameters._LAST_VIEW_NAME_}"> @@ -449,8 +449,8 @@ <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_UNKNOWN_PARTY"/> <if-compare field="communicationEvent.partyIdFrom" operator="not-equals" value="${partyId}"/> - <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> </and> </condition> <link target="${parameters._LAST_VIEW_NAME_}"> @@ -468,8 +468,8 @@ <and> <not><if-empty field="communicationEvent"/></not> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> - <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> - <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE" action="_CREATE"/> </and> </condition> <link target="${parameters._LAST_VIEW_NAME_}"> @@ -489,7 +489,7 @@ <not><if-empty field="communicationEvent"/></not> <not><if-empty field="communicationEvent.partyIdFrom"/></not> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> - <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + <if-has-permission permission="ORDERMGR_CRQ" action="_CREATE"/> <if-compare field="projectMgrExists" operator="equals" value="false"/> <if-compare field="communicationEvent.statusId" operator="equals" value="COM_ENTERED"/> </and> @@ -505,7 +505,7 @@ <not><if-empty field="communicationEvent"/></not> <not><if-empty field="communicationEvent.partyIdFrom"/></not> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> - <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + <if-has-permission permission="ORDERMGR_CRQ" action="_CREATE"/> <if-compare field="projectMgrExists" operator="equals" value="true"/> <if-compare field="communicationEvent.statusId" operator="equals" value="COM_ENTERED"/> </and> @@ -534,7 +534,7 @@ <and> <not><if-empty field="communicationEvent"/></not> <if-compare field="communicationEventRole.statusId" operator="equals" value="COM_ROLE_READ"/> - <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_UPDATE"/> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_UNKNOWN_PARTY"/> </and> </condition> @@ -550,10 +550,7 @@ <condition> <and> <not><if-empty field="communicationEvent"/></not> - <or> - <if-has-permission permission="PARTYMGR_CME-EMAIL_DELETE"/> - <if-has-permission permission="PARTYMGR_ADMIN"/> - </or> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_DELETE"/> </and> </condition> <link target="deleteCommunicationEvent"> @@ -688,7 +685,7 @@ <and> <not><if-empty field="parameters.communicationEventId"/></not> <not><if-empty field="communicationEvent.partyIdFrom"/></not> - <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + <if-has-permission permission="ORDERMGR_CRQ" action="_CREATE"/> <if-compare field="communicationEvent.statusId" operator="equals" value="COM_ENTERED"/> </and> </condition> @@ -712,10 +709,7 @@ <condition> <and> <not><if-empty field="communicationEventRole"/></not> - <or> - <if-has-permission permission="PARTYMGR_CME-EMAIL_DELETE"/> - <if-has-permission permission="PARTYMGR_ADMIN"/> - </or> + <if-has-permission permission="PARTYMGR_CME-EMAIL" action="_DELETE"/> </and> </condition> <link target="RemoveCommunicationEventRole"> Modified: ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/inventory/InventoryServices.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/inventory/InventoryServices.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/inventory/InventoryServices.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/inventory/InventoryServices.xml Tue Oct 17 09:58:24 2017 @@ -36,9 +36,7 @@ under the License. <not> <or> <if-has-permission permission="CATALOG" action="_${checkAction}"/> - <if-has-permission permission="CATALOG_ADMIN"/> <if-has-permission permission="FACILITY" action="_${checkAction}"/> - <if-has-permission permission="FACILITY_ADMIN"/> <and> <not><if-empty field="alternatePermissionRoot"/></not> <if-has-permission permission="${alternatePermissionRoot}" action="_${checkAction}"/> Modified: ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml Tue Oct 17 09:58:24 2017 @@ -603,10 +603,7 @@ under the License. </menu-item> <menu-item name="ImageUpload" title="${uiLabelMap.CommonUpload}"> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_UPLOAD"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_UPLOAD"/> </condition> <link target="ImageUpload"/> </menu-item> @@ -620,28 +617,19 @@ under the License. </menu-item> <menu-item name="ImageApprove" title="${uiLabelMap.ImageManagementApprove}"> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <link target="ImageApprove"/> </menu-item> <menu-item name="ImageRejected" title="${uiLabelMap.CommonRejected}"> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <link target="ImageRejected"/> </menu-item> <menu-item name="ImageRecentlyApproved" title="${uiLabelMap.ImageManagementRecentlyApproved}"> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <link target="ImageRecentlyApproved"/> </menu-item> Modified: ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ImageManagementScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ImageManagementScreens.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ImageManagementScreens.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ImageManagementScreens.xml Tue Oct 17 09:58:24 2017 @@ -30,9 +30,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> </condition> <widgets> <screenlet title="${uiLabelMap.ImageManagementApplication}"> @@ -163,10 +161,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_UPLOAD"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_UPLOAD"/> </condition> <widgets> <screenlet title="${uiLabelMap.CommonUpload}"> @@ -213,10 +208,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <widgets> <platform-specific> @@ -264,10 +256,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <widgets> <platform-specific> @@ -311,10 +300,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <widgets> <screenlet title="${uiLabelMap.CommonRejected}"> @@ -357,10 +343,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <widgets> <platform-specific> @@ -760,10 +743,7 @@ under the License. <decorator-section name="body"> <section> <condition> - <or> - <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/> - <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/> - </or> + <if-has-permission permission="IMAGE_MANAGEMENT" action="_APPROVE"/> </condition> <widgets> <screenlet title="${uiLabelMap.ImageManagementRecentlyApproved}"> Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/widget/ArtifactInfoScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/widget/ArtifactInfoScreens.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/webtools/widget/ArtifactInfoScreens.xml (original) +++ ofbiz/ofbiz-framework/trunk/framework/webtools/widget/ArtifactInfoScreens.xml Tue Oct 17 09:58:24 2017 @@ -23,7 +23,7 @@ under the License. <screen name="ArtifactInfo" transaction-timeout="180"> <section> <condition> - <if-has-permission permission="ARTIFACT_INFO_VIEW"/> + <if-has-permission permission="ARTIFACT_INFO" action="_VIEW"/> </condition> <actions> <set field="titleProperty" value="WebtoolsArtifactInfo"/> Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/widget/LabelManagerScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/widget/LabelManagerScreens.xml?rev=1812381&r1=1812380&r2=1812381&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/webtools/widget/LabelManagerScreens.xml (original) +++ ofbiz/ofbiz-framework/trunk/framework/webtools/widget/LabelManagerScreens.xml Tue Oct 17 09:58:24 2017 @@ -24,7 +24,7 @@ under the License. <screen name="SearchLabels" transaction-timeout="600"> <section> <condition> - <if-has-permission permission="LABEL_MANAGER_VIEW"/> + <if-has-permission permission="LABEL_MANAGER" action="_VIEW"/> </condition> <actions> <set field="titleProperty" value="WebtoolsLabelManagerFindLabels"/> @@ -59,7 +59,7 @@ under the License. <screen name="UpdateLabel"> <section> <condition> - <if-has-permission permission="LABEL_MANAGER_VIEW"/> + <if-has-permission permission="LABEL_MANAGER" action="_VIEW"/> </condition> <actions> <set field="titleProperty" value="WebtoolsLabelManagerAddNew"/> @@ -84,7 +84,7 @@ under the License. <screen name="ViewReferences"> <section> <condition> - <if-has-permission permission="LABEL_MANAGER_VIEW"/> + <if-has-permission permission="LABEL_MANAGER" action="_VIEW"/> </condition> <actions> <set field="titleProperty" value="WebtoolsLabelManagerViewReferences"/> @@ -106,7 +106,7 @@ under the License. <screen name="ViewFile"> <section> <condition> - <if-has-permission permission="LABEL_MANAGER_VIEW"/> + <if-has-permission permission="LABEL_MANAGER" action="_VIEW"/> </condition> <actions> <set field="titleProperty" value="WebtoolsLabelManagerViewFile"/> |
Free forum by Nabble | Edit this page |