Skip to content

Commit

Permalink
Added the CRUD feactures, validations fields #66
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanLP06 committed Jul 24, 2023
1 parent 35dd712 commit d82e2ce
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 35 deletions.
14 changes: 14 additions & 0 deletions backend/src/slc_web/src/slc_web/permissions.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
title="Community Sponsor: Manage Sponsors"
/>

<!-- Permissions for Community Member content type -->
<permission
id="slc_web.communitymember.add"
title="Community Member: Add Community Member"
/>
<permission
id="slc_web.communitymember.view"
title="Community Member: View Detail"
/>
<permission
id="slc_web.communitymember.manage"
title="Community Member: Manage Members"
/>

</configure>

</configure>
21 changes: 21 additions & 0 deletions backend/src/slc_web/src/slc_web/profiles/default/rolemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<rolemap>
<roles>
<role name="Community Sponsorship Committee" />
<role name="Community Membership Committee" />
</roles>
<permissions>
<permission acquire="True"
Expand All @@ -23,5 +24,25 @@
<role name="Community Sponsorship Committee" />
<role name="Manager" />
</permission>

<permission acquire="True"
name="Community Member: Add Community Member"
>
<role name="Community Membership Committee" />
<role name="Manager" />
<role name="Site Administrator" />
</permission>
<permission acquire="True"
name="Community Member: View Detail"
>
<role name="Community Membership Committee" />
<role name="Manager" />
</permission>
<permission acquire="True"
name="Community Member: Manage Members"
>
<role name="Community Membership Committee" />
<role name="Manager" />
</permission>
</permissions>
</rolemap>
3 changes: 3 additions & 0 deletions backend/src/slc_web/src/slc_web/profiles/default/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
<object meta_type="Dexterity FTI"
name="CommunitySponsor"
/>
<object meta_type="Dexterity FTI"
name="CommunityMember"
/>
</object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
meta_type="Dexterity FTI"
name="CommunityMember"
i18n:domain="slc_web"
>

<!-- Basic properties -->
<property name="title"
i18n:translate=""
>Community Member</property>
<property name="description"
i18n:translate=""
>A Community Member</property>
<property name="icon_expr">string:person-add</property>
<property name="factory">CommunityMember</property>
<property name="link_target" />

<!-- Hierarchy control -->
<property name="filter_content_types">True</property>
<property name="allowed_content_types" />
<property name="global_allow">True</property>

<!-- Schema, class and security -->
<property name="allow_discussion">False</property>
<property name="add_permission">slc_web.communitymember.add</property>
<property name="klass">plone.dexterity.content.Item</property>
<property name="model_file">slc_web.schema:communitymember.xml</property>
<property name="schema" />
<property name="model_source" />
<property name="schema_policy">dexterity</property>

<!-- Enabled behaviors -->
<property name="behaviors"
purge="false"
>
<!-- Details about all standard behaviors following can be read at
https://6.docs.plone.org/backend/behaviors.html
-->
<element value="plone.categorization" />
<element value="plone.textindexer" />
<element value="plone.namefromtitle" />
</property>

<!-- View information -->
<property name="add_view_expr">string:${folder_url}/++add++CommunityMember</property>
<property name="default_view">view</property>
<property name="default_view_fallback">False</property>
<property name="immediate_view">view</property>
<property name="view_methods">
<element value="view" />
</property>

<!-- Method aliases -->
<alias from="(Default)"
to="(dynamic view)"
/>
<alias from="edit"
to="@@edit"
/>
<alias from="sharing"
to="@@sharing"
/>
<alias from="view"
to="(selected layout)"
/>

<!-- Actions -->
<action action_id="view"
category="object"
condition_expr=""
icon_expr="string:toolbar-action/view"
link_target=""
title="View"
url_expr="string:${object_url}"
visible="True"
i18n:attributes="title"
i18n:domain="plone"
>
<permission value="View" />
</action>
<action action_id="edit"
category="object"
condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True"
icon_expr="string:toolbar-action/edit"
link_target=""
title="Edit"
url_expr="string:${object_url}/edit"
visible="True"
i18n:attributes="title"
i18n:domain="plone"
>
<permission value="Modify portal content" />
</action>

</object>
Loading

0 comments on commit d82e2ce

Please sign in to comment.