diff --git a/applications/accounting/data/AccountingSecurityGroupDemoData.xml b/applications/accounting/data/AccountingSecurityGroupDemoData.xml
index 42c6520962..4f9ba1f033 100644
--- a/applications/accounting/data/AccountingSecurityGroupDemoData.xml
+++ b/applications/accounting/data/AccountingSecurityGroupDemoData.xml
@@ -19,84 +19,84 @@ under the License.
-->
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/accounting/data/AccountingSecurityPermissionSeedData.xml b/applications/accounting/data/AccountingSecurityPermissionSeedData.xml
index 0065993287..1d5a2537d9 100644
--- a/applications/accounting/data/AccountingSecurityPermissionSeedData.xml
+++ b/applications/accounting/data/AccountingSecurityPermissionSeedData.xml
@@ -67,11 +67,11 @@ under the License.
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/applications/commonext/data/CommonExtSecurityGroupDemoData.xml b/applications/commonext/data/CommonExtSecurityGroupDemoData.xml
index 2e46e4a415..39a0cd64ec 100644
--- a/applications/commonext/data/CommonExtSecurityGroupDemoData.xml
+++ b/applications/commonext/data/CommonExtSecurityGroupDemoData.xml
@@ -20,5 +20,5 @@ under the License.
-
+
diff --git a/applications/commonext/data/CommonExtSecurityPermissionSeedData.xml b/applications/commonext/data/CommonExtSecurityPermissionSeedData.xml
index 7cd6ea4478..cbad64db22 100644
--- a/applications/commonext/data/CommonExtSecurityPermissionSeedData.xml
+++ b/applications/commonext/data/CommonExtSecurityPermissionSeedData.xml
@@ -23,5 +23,5 @@ under the License.
-
+
diff --git a/applications/commonext/data/OfbizSetupSecurityGroupDemoData.xml b/applications/commonext/data/OfbizSetupSecurityGroupDemoData.xml
index 6ff7ec310a..7ef212a14d 100644
--- a/applications/commonext/data/OfbizSetupSecurityGroupDemoData.xml
+++ b/applications/commonext/data/OfbizSetupSecurityGroupDemoData.xml
@@ -18,5 +18,5 @@ specific language governing permissions and limitations
under the License.
-->
-
+
diff --git a/applications/commonext/data/OfbizSetupSecurityPermissionSeedData.xml b/applications/commonext/data/OfbizSetupSecurityPermissionSeedData.xml
index 00a14006e1..cdc942e4f6 100644
--- a/applications/commonext/data/OfbizSetupSecurityPermissionSeedData.xml
+++ b/applications/commonext/data/OfbizSetupSecurityPermissionSeedData.xml
@@ -21,5 +21,5 @@ under the License.
-
+
diff --git a/applications/content/data/CompDocData.xml b/applications/content/data/CompDocData.xml
index deaf3267ca..5fea8b84bd 100644
--- a/applications/content/data/CompDocData.xml
+++ b/applications/content/data/CompDocData.xml
@@ -19,11 +19,11 @@ under the License.
-->
-
-
-
-
-
+
+
+
+
+
diff --git a/applications/content/data/ContentSecurityGroupDemoData.xml b/applications/content/data/ContentSecurityGroupDemoData.xml
index 3afed11ea8..38c5f0ac32 100644
--- a/applications/content/data/ContentSecurityGroupDemoData.xml
+++ b/applications/content/data/ContentSecurityGroupDemoData.xml
@@ -19,24 +19,24 @@ under the License.
-->
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
diff --git a/applications/content/data/ContentSecurityPermissionSeedData.xml b/applications/content/data/ContentSecurityPermissionSeedData.xml
index 9316babea2..9ecae6d1eb 100644
--- a/applications/content/data/ContentSecurityPermissionSeedData.xml
+++ b/applications/content/data/ContentSecurityPermissionSeedData.xml
@@ -35,6 +35,6 @@ under the License.
-
-
+
+
diff --git a/applications/humanres/data/HumanResDemoData.xml b/applications/humanres/data/HumanResDemoData.xml
index 7cdda625e6..0b9010a93f 100644
--- a/applications/humanres/data/HumanResDemoData.xml
+++ b/applications/humanres/data/HumanResDemoData.xml
@@ -38,7 +38,7 @@ under the License.
-
+
diff --git a/applications/humanres/data/HumanResSecurityGroupDemoData.xml b/applications/humanres/data/HumanResSecurityGroupDemoData.xml
index f99b19e338..d359c96b83 100644
--- a/applications/humanres/data/HumanResSecurityGroupDemoData.xml
+++ b/applications/humanres/data/HumanResSecurityGroupDemoData.xml
@@ -19,30 +19,30 @@ under the License.
-->
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/humanres/data/HumanResSecurityPermissionSeedData.xml b/applications/humanres/data/HumanResSecurityPermissionSeedData.xml
index d2018780cb..f63fed84cc 100644
--- a/applications/humanres/data/HumanResSecurityPermissionSeedData.xml
+++ b/applications/humanres/data/HumanResSecurityPermissionSeedData.xml
@@ -28,5 +28,5 @@ under the License.
-
+
diff --git a/applications/manufacturing/data/ManufacturingSecurityGroupDemoData.xml b/applications/manufacturing/data/ManufacturingSecurityGroupDemoData.xml
index 3d09b641b6..cac6ab9467 100644
--- a/applications/manufacturing/data/ManufacturingSecurityGroupDemoData.xml
+++ b/applications/manufacturing/data/ManufacturingSecurityGroupDemoData.xml
@@ -20,11 +20,11 @@ under the License.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/applications/manufacturing/data/ManufacturingSecurityPermissionSeedData.xml b/applications/manufacturing/data/ManufacturingSecurityPermissionSeedData.xml
index 1c8d864fa9..80201fad5a 100644
--- a/applications/manufacturing/data/ManufacturingSecurityPermissionSeedData.xml
+++ b/applications/manufacturing/data/ManufacturingSecurityPermissionSeedData.xml
@@ -27,5 +27,5 @@ under the License.
-
+
diff --git a/applications/manufacturing/testdef/data/ManufacturingTestsData.xml b/applications/manufacturing/testdef/data/ManufacturingTestsData.xml
index 5be410a9e5..97be258d37 100644
--- a/applications/manufacturing/testdef/data/ManufacturingTestsData.xml
+++ b/applications/manufacturing/testdef/data/ManufacturingTestsData.xml
@@ -20,27 +20,27 @@ under the License.
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/applications/marketing/data/MarketingSecurityGroupDemoData.xml b/applications/marketing/data/MarketingSecurityGroupDemoData.xml
index 8570dbcd89..192427c73d 100644
--- a/applications/marketing/data/MarketingSecurityGroupDemoData.xml
+++ b/applications/marketing/data/MarketingSecurityGroupDemoData.xml
@@ -20,21 +20,21 @@ under the License.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/applications/marketing/data/MarketingSecurityPermissionSeedData.xml b/applications/marketing/data/MarketingSecurityPermissionSeedData.xml
index 8baac1e0e8..f944f66e12 100644
--- a/applications/marketing/data/MarketingSecurityPermissionSeedData.xml
+++ b/applications/marketing/data/MarketingSecurityPermissionSeedData.xml
@@ -38,7 +38,7 @@ under the License.
-
-
+
+
diff --git a/applications/order/data/OrderSecurityGroupDemoData.xml b/applications/order/data/OrderSecurityGroupDemoData.xml
index 094e074191..0cbdcae1e8 100644
--- a/applications/order/data/OrderSecurityGroupDemoData.xml
+++ b/applications/order/data/OrderSecurityGroupDemoData.xml
@@ -28,98 +28,98 @@ under the License.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/order/data/OrderSecurityPermissionSeedData.xml b/applications/order/data/OrderSecurityPermissionSeedData.xml
index 196a810b3d..88dea2718d 100644
--- a/applications/order/data/OrderSecurityPermissionSeedData.xml
+++ b/applications/order/data/OrderSecurityPermissionSeedData.xml
@@ -45,6 +45,6 @@ under the License.
-
-
+
+
diff --git a/applications/party/data/PartySecurityGroupDemoData.xml b/applications/party/data/PartySecurityGroupDemoData.xml
index 139147e6c1..9a37a4e98e 100644
--- a/applications/party/data/PartySecurityGroupDemoData.xml
+++ b/applications/party/data/PartySecurityGroupDemoData.xml
@@ -21,42 +21,42 @@ under the License.
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
diff --git a/applications/party/data/PartySecurityPermissionSeedData.xml b/applications/party/data/PartySecurityPermissionSeedData.xml
index 4952c96930..167edf1ca3 100644
--- a/applications/party/data/PartySecurityPermissionSeedData.xml
+++ b/applications/party/data/PartySecurityPermissionSeedData.xml
@@ -56,7 +56,7 @@ under the License.
-
-
+
+
diff --git a/applications/product/data/FacilitySecurityGroupDemoData.xml b/applications/product/data/FacilitySecurityGroupDemoData.xml
index f2954afd10..7e7fe3a905 100644
--- a/applications/product/data/FacilitySecurityGroupDemoData.xml
+++ b/applications/product/data/FacilitySecurityGroupDemoData.xml
@@ -21,12 +21,12 @@ under the License.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/applications/product/data/FacilitySecurityPermissionSeedData.xml b/applications/product/data/FacilitySecurityPermissionSeedData.xml
index f9c7098ec7..d9e90277db 100644
--- a/applications/product/data/FacilitySecurityPermissionSeedData.xml
+++ b/applications/product/data/FacilitySecurityPermissionSeedData.xml
@@ -30,6 +30,6 @@ under the License.
-
+
diff --git a/applications/product/data/ProductSecurityGroupDemoData.xml b/applications/product/data/ProductSecurityGroupDemoData.xml
index d34e1ee4e9..758978abac 100644
--- a/applications/product/data/ProductSecurityGroupDemoData.xml
+++ b/applications/product/data/ProductSecurityGroupDemoData.xml
@@ -21,49 +21,49 @@ under the License.
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
diff --git a/applications/product/data/ProductSecurityPermissionSeedData.xml b/applications/product/data/ProductSecurityPermissionSeedData.xml
index 0aa0ec005a..b7a9b2dc1a 100644
--- a/applications/product/data/ProductSecurityPermissionSeedData.xml
+++ b/applications/product/data/ProductSecurityPermissionSeedData.xml
@@ -38,10 +38,10 @@ under the License.
-
-
-
-
-
+
+
+
+
+
diff --git a/applications/workeffort/data/WorkEffortSecurityGroupDemoData.xml b/applications/workeffort/data/WorkEffortSecurityGroupDemoData.xml
index 8ac95a2606..8d22a63626 100644
--- a/applications/workeffort/data/WorkEffortSecurityGroupDemoData.xml
+++ b/applications/workeffort/data/WorkEffortSecurityGroupDemoData.xml
@@ -20,25 +20,25 @@ under the License.
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
diff --git a/applications/workeffort/data/WorkEffortSecurityPermissionSeedData.xml b/applications/workeffort/data/WorkEffortSecurityPermissionSeedData.xml
index fc094b4d9d..79f4927de8 100644
--- a/applications/workeffort/data/WorkEffortSecurityPermissionSeedData.xml
+++ b/applications/workeffort/data/WorkEffortSecurityPermissionSeedData.xml
@@ -31,5 +31,5 @@ under the License.
-
+
diff --git a/framework/common/data/CommonSecurityGroupDemoData.xml b/framework/common/data/CommonSecurityGroupDemoData.xml
index 05b57a1de5..62b91d67ef 100644
--- a/framework/common/data/CommonSecurityGroupDemoData.xml
+++ b/framework/common/data/CommonSecurityGroupDemoData.xml
@@ -20,24 +20,24 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
diff --git a/framework/common/data/CommonSecurityPermissionSeedData.xml b/framework/common/data/CommonSecurityPermissionSeedData.xml
index ddb0cc84be..5ea573fcfd 100644
--- a/framework/common/data/CommonSecurityPermissionSeedData.xml
+++ b/framework/common/data/CommonSecurityPermissionSeedData.xml
@@ -38,10 +38,10 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/framework/common/servicedef/services_security.xml b/framework/common/servicedef/services_security.xml
index 7fb3add593..4ef8768a3a 100644
--- a/framework/common/servicedef/services_security.xml
+++ b/framework/common/servicedef/services_security.xml
@@ -58,12 +58,28 @@ under the License.
+
+
+
+
+ Update a SecurityPermission from a SecurityGroup
+
+
+
+
+
+
+
+ Expire a SecurityPermission from a SecurityGroup
+
+
Remove a SecurityPermission from a SecurityGroup
+
diff --git a/framework/common/widget/SecurityForms.xml b/framework/common/widget/SecurityForms.xml
index da45ef0b04..cebc99791b 100644
--- a/framework/common/widget/SecurityForms.xml
+++ b/framework/common/widget/SecurityForms.xml
@@ -32,6 +32,8 @@ under the License.
+
+
@@ -39,7 +41,9 @@ under the License.
header-row-style="header-row" default-table-style="basic-table">
-
+
+
+
@@ -145,10 +149,13 @@ under the License.
+
+
+
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java
index 65193506e4..bab665c178 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java
@@ -30,6 +30,7 @@ import org.apache.ofbiz.base.config.GenericConfigException;
import org.apache.ofbiz.base.config.MainResourceHandler;
import org.apache.ofbiz.base.config.ResourceHandler;
import org.apache.ofbiz.base.util.Debug;
+import org.apache.ofbiz.base.util.UtilDateTime;
import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.entity.Delegator;
@@ -293,7 +294,7 @@ public class EntityDataLoader {
baseName + "_ADMIN",
"description",
"Permission to Administer a " + entity.getEntityName() + " entity."));
- toBeStored.add(delegator.makeValue("SecurityGroupPermission", "groupId", "FULLADMIN", "permissionId", baseName + "_ADMIN"));
+ toBeStored.add(delegator.makeValue("SecurityGroupPermission", "groupId", "FULLADMIN", "permissionId", baseName + "_ADMIN", "fromDate", UtilDateTime.nowTimestamp()));
rowsChanged += delegator.storeAll(toBeStored);
} catch (GenericEntityException e) {
errorMessages.add("[generateData] ERROR: Failed Security Generation for entity \"" + baseName + "\"");
diff --git a/framework/entityext/data/EntityExtSecurityGroupDemoData.xml b/framework/entityext/data/EntityExtSecurityGroupDemoData.xml
index 614eb08699..0b233407fa 100644
--- a/framework/entityext/data/EntityExtSecurityGroupDemoData.xml
+++ b/framework/entityext/data/EntityExtSecurityGroupDemoData.xml
@@ -19,6 +19,6 @@ under the License.
-->
-
-
+
+
diff --git a/framework/entityext/data/EntityExtSecurityPermissionSeedData.xml b/framework/entityext/data/EntityExtSecurityPermissionSeedData.xml
index a9a9e35483..08eaa31440 100644
--- a/framework/entityext/data/EntityExtSecurityPermissionSeedData.xml
+++ b/framework/entityext/data/EntityExtSecurityPermissionSeedData.xml
@@ -22,6 +22,6 @@ under the License.
-
+
diff --git a/framework/resources/templates/SecurityGroupDemoData.xml b/framework/resources/templates/SecurityGroupDemoData.xml
index 9bcc560d6b..cb885a5dc9 100644
--- a/framework/resources/templates/SecurityGroupDemoData.xml
+++ b/framework/resources/templates/SecurityGroupDemoData.xml
@@ -19,11 +19,11 @@ under the License.
-->
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/framework/resources/templates/SecurityPermissionSeedData.xml b/framework/resources/templates/SecurityPermissionSeedData.xml
index 357fc6255e..84f883cc20 100644
--- a/framework/resources/templates/SecurityPermissionSeedData.xml
+++ b/framework/resources/templates/SecurityPermissionSeedData.xml
@@ -25,6 +25,6 @@ under the License.
-
+
diff --git a/framework/security/data/SecurityGroupDemoData.xml b/framework/security/data/SecurityGroupDemoData.xml
index f32fe70051..a2605e8997 100644
--- a/framework/security/data/SecurityGroupDemoData.xml
+++ b/framework/security/data/SecurityGroupDemoData.xml
@@ -28,10 +28,10 @@ under the License.
-
-
-
-
+
+
+
+
diff --git a/framework/security/data/SecurityPermissionSeedData.xml b/framework/security/data/SecurityPermissionSeedData.xml
index a6ea6b4dc7..aefdc5877b 100644
--- a/framework/security/data/SecurityPermissionSeedData.xml
+++ b/framework/security/data/SecurityPermissionSeedData.xml
@@ -32,7 +32,7 @@ under the License.
-
+
@@ -40,10 +40,10 @@ under the License.
-
-
-
-
-
+
+
+
+
+
diff --git a/framework/security/entitydef/entitymodel.xml b/framework/security/entitydef/entitymodel.xml
index 06670816a2..15944477f0 100644
--- a/framework/security/entitydef/entitymodel.xml
+++ b/framework/security/entitydef/entitymodel.xml
@@ -144,8 +144,11 @@ under the License.
Defines a permission available to a security group; there is no FK to SecurityPermission because we want to leave open the possibility of ad-hoc permissions, especially for the Entity Data Maintenance pages which have TONS of permissions
+
+
+
diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java b/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java
index 32a41524ce..696a9ec9a0 100644
--- a/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java
+++ b/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java
@@ -263,7 +263,7 @@ public final class SecurityFactory {
@Deprecated
public boolean securityGroupPermissionExists(String groupId, String permission) {
try {
- return EntityQuery.use(delegator).from("SecurityGroupPermission").where("groupId", groupId, "permissionId", permission).cache(true).queryOne() != null;
+ return EntityQuery.use(delegator).from("SecurityGroupPermission").where("groupId", groupId, "permissionId", permission).cache(true).filterByDate().queryFirst() != null;
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return false;
diff --git a/framework/service/data/ServiceSecurityGroupDemoData.xml b/framework/service/data/ServiceSecurityGroupDemoData.xml
index 704fd222cf..4a4c323faf 100644
--- a/framework/service/data/ServiceSecurityGroupDemoData.xml
+++ b/framework/service/data/ServiceSecurityGroupDemoData.xml
@@ -19,6 +19,6 @@ under the License.
-->
-
-
+
+
diff --git a/framework/service/data/ServiceSecurityPermissionSeedData.xml b/framework/service/data/ServiceSecurityPermissionSeedData.xml
index ef45ccf585..1fd07cef1c 100644
--- a/framework/service/data/ServiceSecurityPermissionSeedData.xml
+++ b/framework/service/data/ServiceSecurityPermissionSeedData.xml
@@ -22,6 +22,6 @@ under the License.
-
+
diff --git a/framework/webtools/data/WebtoolsSecurityGroupDemoData.xml b/framework/webtools/data/WebtoolsSecurityGroupDemoData.xml
index 6fad6a2710..7a246f0f47 100644
--- a/framework/webtools/data/WebtoolsSecurityGroupDemoData.xml
+++ b/framework/webtools/data/WebtoolsSecurityGroupDemoData.xml
@@ -19,63 +19,63 @@ under the License.
-->
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/framework/webtools/data/WebtoolsSecurityPermissionSeedData.xml b/framework/webtools/data/WebtoolsSecurityPermissionSeedData.xml
index c2b411da2d..70cd28b8b6 100644
--- a/framework/webtools/data/WebtoolsSecurityPermissionSeedData.xml
+++ b/framework/webtools/data/WebtoolsSecurityPermissionSeedData.xml
@@ -58,21 +58,21 @@ under the License.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+