Setting rights on specific attributes

Author Message

Helle Andersen

Thursday 29 April 2010 6:49:17 am

In a few cases we would like to set specific rights on specific.attributes.

E.g. we would like to add an attribute to all our classes with a metadata/keyword attribute. But we would like this attribute to be filled out only by our Communication department, not by all our ca. 200 users.

Has anyone any idea how/if this can be done?

André R.

Thursday 29 April 2010 12:05:34 pm

Currently you'll have to check access in edit templates for stuff like this.

There is an old patch around to add policy checks to attributes, but no idea when something like this might be part of eZ Publish out of the box. There is also the possibility that policy limitation on class attribute category(4.3 feature) is implemented instead, but both cases would solve your case without having to hard code business logic in templates.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Bertrand Dunogier

Thursday 29 April 2010 12:59:24 pm

Andre has summarized the basics correctly.

If security is important for you (not sure it is with a department, but whatever), you could also use the same configuration as you would use the customize the template inside a workflow event and reject data that doens't match 'em.

Such a configuration could look like this:

[global]
; XXX is the Communication department's content object ID
AttributePermissions[XXX]=all;deny
AttributePermissions[XXX]=keywords;allow

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

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 05:04:48
Script start
Timing: Jan 18 2025 05:04:48
Module start 'layout'
Timing: Jan 18 2025 05:04:48
Module start 'content'
Timing: Jan 18 2025 05:04:49
Module end 'content'
Timing: Jan 18 2025 05:04:49
Script end

Main resources:

Total runtime0.5983 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9297152.6250
Module start 'layout' 0.00590.0041 740.554739.4453
Module start 'content' 0.01000.5867 780.0000578.1953
Module end 'content' 0.59670.0015 1,358.195312.1563
Script end 0.5982  1,370.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5552160.0002
Check MTime0.00150.2436160.0001
Mysql Total
Database connection0.00090.143410.0009
Mysqli_queries0.549991.9098590.0093
Looping result0.00100.1622570.0000
Template Total0.563894.220.2819
Template load0.00240.393020.0012
Template processing0.561593.844220.2807
Template load and register function0.00030.043010.0003
states
state_id_array0.00220.361710.0022
state_identifier_array0.00140.238220.0007
Override
Cache load0.00200.3295160.0001
Sytem overhead
Fetch class attribute can translate value0.00050.087230.0002
Fetch class attribute name0.00120.195250.0002
XML
Image XML parsing0.00110.176830.0004
class_abstraction
Instantiating content class attribute0.00000.001750.0000
General
dbfile0.00070.1245230.0000
String conversion0.00000.001840.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs