Author: adrianc
Date: Fri Aug 21 17:12:27 2009 New Revision: 806648 URL: http://svn.apache.org/viewvc?rev=806648&view=rev Log: Entity definitions and initial seed data for security redesign. I'm not sure about the ArtifactPath entity name, could also be called ExecutionPath. Modified: ofbiz/branches/executioncontext20090812/framework/security/data/SecurityData.xml ofbiz/branches/executioncontext20090812/framework/security/entitydef/entitymodel.xml Modified: ofbiz/branches/executioncontext20090812/framework/security/data/SecurityData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/security/data/SecurityData.xml?rev=806648&r1=806647&r2=806648&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/security/data/SecurityData.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/security/data/SecurityData.xml Fri Aug 21 17:12:27 2009 @@ -55,4 +55,21 @@ <!-- System UserLogin Account - see additional data in SecurityExtData --> <UserLogin userLoginId="system" enabled="N" isSystem="Y"/> <UserLoginSecurityGroup groupId="FULLADMIN" userLoginId="system" fromDate="2001-01-01 12:00:00.0"/> + + <!-- Data needed to bootstrap the security-aware artifacts --> + + <UserLogin userLoginId="NOT_LOGGED_IN" enabled="N" isSystem="N"/> + <UserGroup groupId="OFBIZ_USERS" description="All OFBiz users"/> + <ArtifactPath artifactPath="ofbiz" description="The artifact path root"/> + <ArtifactPermission permissionValue="admin=true" description="Admin access granted"/> + <ArtifactPermission permissionValue="create=true" description="Create access granted"/> + <ArtifactPermission permissionValue="create=false" description="Create access denied"/> + <ArtifactPermission permissionValue="delete=true" description="Delete access granted"/> + <ArtifactPermission permissionValue="delete=false" description="Delete access denied"/> + <ArtifactPermission permissionValue="update=true" description="Update access granted"/> + <ArtifactPermission permissionValue="update=false" description="Update access denied"/> + <ArtifactPermission permissionValue="view=true" description="View access granted"/> + <ArtifactPermission permissionValue="view=false" description="View access denied"/> + <UserToArtifactPermissionRel userLoginId="system" artifactPath="ofbiz" permissionValue="admin=true"/> + </entity-engine-xml> Modified: ofbiz/branches/executioncontext20090812/framework/security/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/security/entitydef/entitymodel.xml?rev=806648&r1=806647&r2=806648&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/security/entitydef/entitymodel.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/security/entitydef/entitymodel.xml Fri Aug 21 17:12:27 2009 @@ -247,4 +247,115 @@ <prim-key field="viewNameId"/> <prim-key field="userLoginId"/> </entity> + + <!-- ========================================================= --> + <!-- org.ofbiz.security.artifactsecurity --> + <!-- ========================================================= --> + + <entity entity-name="UserGroup" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - User Group Entity"> + <field name="groupId" type="id-ne"/> + <field name="description" type="description"/> + <prim-key field="groupId"/> + </entity> + + <entity entity-name="UserGroupRelationship" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - User Group-To-User Group Relationship Entity"> + <field name="fromGroupId" type="id-ne"> + <description>The parent user group</description> + </field> + <field name="toGroupId" type="id-ne"> + <description>The child user group</description> + </field> + <prim-key field="fromGroupId"/> + <prim-key field="toGroupId"/> + <relation type="one" fk-name="UGR_FROM_GROUP" rel-entity-name="UserGroup"> + <key-map field-name="fromGroupId" rel-field-name="groupId"/> + </relation> + <relation type="one" fk-name="UGR_TO_GROUP" rel-entity-name="UserGroup"> + <key-map field-name="toGroupId" rel-field-name="groupId"/> + </relation> + </entity> + + <entity entity-name="UserToUserGroupRelationship" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - User-To-User Group Relationship Entity"> + <field name="groupId" type="id-ne"/> + <field name="userLoginId" type="id-vlong-ne"/> + <prim-key field="groupId"/> + <prim-key field="userLoginId"/> + <relation type="one" fk-name="UTUGR_GROUP" rel-entity-name="UserGroup"> + <key-map field-name="groupId"/> + </relation> + <relation type="one" fk-name="UTUGR_USER_LOGIN" rel-entity-name="UserLogin"> + <key-map field-name="userLoginId"/> + </relation> + </entity> + + <entity entity-name="ArtifactPermission" + package-name="org.ofbiz.security.artifactsecurity" + title="Security Component - Artifact Permission Entity"> + <field name="permissionValue" type="id-long-ne"> + <description>The permission value: create=true, service=checkPermission, filter=someFilter</description> + </field> + <field name="description" type="description"/> + <prim-key field="permissionValue"/> + </entity> + + <entity entity-name="ArtifactPath" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - Artifact Path Entity"> + <field name="artifactPath" type="id-vlong-ne"/> + <field name="description" type="description"/> + <prim-key field="artifactPath"/> + </entity> + + <entity entity-name="UserToArtifactPermissionRel" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - User-To-Artifact Permission Relationship Entity"> + <field name="userLoginId" type="id-vlong-ne"/> + <field name="artifactPath" type="id-vlong-ne"/> + <field name="permissionValue" type="id-long-ne"/> + <prim-key field="userLoginId"/> + <prim-key field="artifactPath"/> + <prim-key field="permissionValue"/> + <relation type="one" fk-name="UAP_USER_LOGIN" rel-entity-name="UserLogin"> + <key-map field-name="userLoginId"/> + </relation> + <relation type="one" fk-name="UAP_ARTFCT_PATH" rel-entity-name="ArtifactPath"> + <key-map field-name="artifactPath"/> + </relation> + <relation type="one" fk-name="UAP_ARTFCT_PERM" rel-entity-name="ArtifactPermission"> + <key-map field-name="permissionValue"/> + </relation> + </entity> + + <entity entity-name="UserGroupToArtifactPermissionRel" + package-name="org.ofbiz.security.artifactsecurity" + default-resource-name="SecurityEntityLabels" + title="Security Component - User Group-To-Artifact Permission Relationship Entity"> + <field name="groupId" type="id-ne"/> + <field name="artifactPath" type="id-vlong-ne"/> + <field name="permissionValue" type="id-long-ne"/> + <prim-key field="userLoginId"/> + <prim-key field="artifactPath"/> + <prim-key field="permissionValue"/> + <relation type="one" fk-name="UGAP_USER_GROUP" rel-entity-name="UserGroup"> + <key-map field-name="groupId"/> + </relation> + <relation type="one" fk-name="UGAP_ARTFCT_PATH" rel-entity-name="ArtifactPath"> + <key-map field-name="artifactPath"/> + </relation> + <relation type="one" fk-name="UGAP_ARTFCT_PERM" rel-entity-name="ArtifactPermission"> + <key-map field-name="permissionValue"/> + </relation> + </entity> + </entitymodel> |
Free forum by Nabble | Edit this page |