Parent classes and child classes

Author Message

Andrey Astakhov

Friday 07 July 2006 10:15:10 am

I have 3 classes: Class A, Class B, Class C.
Class A is a container.
I need to setup it so that an instance of Class A could contain ONLY instances of classes B and C.
For example, <b>User groups</b> could contain only <b>Users</b>.

If is very simple, just show me please a page in the eZ documentation.

Łukasz Serwatka

Friday 07 July 2006 11:15:59 am

Hi Andre,

You did not specify if your question is related directly to permissions but, you can easily setup new police as following:

Module: content
Function: create
Limitations: Class( Class B , Class C ) , ParentClass( Class A )

Module: content
Function: edit
Limitations: Class( Class B , Class C )

This means that you can create objects as instance of classes Class B and Class C under object as instance Class A.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Andrey Astakhov

Friday 07 July 2006 1:09:35 pm

Thank you, Lukasz!

<i>You did not specify if your question is related directly to permissions ...</i>

Yes, you are right.
I already knew this approach with permissions and limitations, but i'm not sure that it is single and best approach. It is impossible to add an instance of the class "User" to content tree, isn't it? Is it based on permissions?
I wondering is there another approach: probably object relations or something like this?

Łukasz Serwatka

Friday 07 July 2006 1:30:57 pm

By default you can't create User object as instance in the content tree. Other approach is that you can control edit form on the template level, if current node class id/identifier is "something" then show "create new object" edit form or not. I would recommend use permissions for control if user has access to create new object under specified content classes.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Andrey Astakhov

Friday 07 July 2006 1:39:58 pm

Ok, thank you.
About permissions: my user from the user group "Editors" doesn't see content tree in the left panel. How should i change his permissions to allow him see (and navigate through) this tree?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:36:47
Script start
Timing: Jan 18 2025 19:36:47
Module start 'layout'
Timing: Jan 18 2025 19:36:47
Module start 'content'
Timing: Jan 18 2025 19:36:48
Module end 'content'
Timing: Jan 18 2025 19:36:48
Script end

Main resources:

Total runtime0.9793 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0038 587.9375152.6250
Module start 'layout' 0.00380.0032 740.562539.4453
Module start 'content' 0.00710.9710 780.0078562.5000
Module end 'content' 0.97800.0012 1,342.507812.1563
Script end 0.9793  1,354.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.2899160.0002
Check MTime0.00120.1242160.0001
Mysql Total
Database connection0.00040.044610.0004
Mysqli_queries0.927094.6554630.0147
Looping result0.00060.0657610.0000
Template Total0.951897.220.4759
Template load0.00210.211820.0010
Template processing0.949796.980420.4749
Template load and register function0.00020.023710.0002
states
state_id_array0.00120.120210.0012
state_identifier_array0.00070.071220.0003
Override
Cache load0.00180.1806310.0001
Sytem overhead
Fetch class attribute can translate value0.00060.060620.0003
Fetch class attribute name0.00130.135460.0002
XML
Image XML parsing0.00100.106220.0005
class_abstraction
Instantiating content class attribute0.00000.001970.0000
General
dbfile0.00070.0725180.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs