Extensions and Roles

Author Message

Carlos Revillo

Thursday 22 December 2005 4:39:54 am

Hi. I'm developing a small extension for my porpouses. In function_definition.php of the extension, i have defined to functions. One is called 'add' and the other one is called 'view'.

Now, i want give access to anonymous role to 'add' function but not to 'view' function. I know how to give access to anonymous role to all functions of my extension, but how i can give only to one of them?.

Kristof Coomans

Thursday 22 December 2005 5:36:08 am

The functions you are talking about, are template fetch functions. They are not the same as the policy functions used by the role system.

As far as i know, you can not add policies for fetch functions. You can only assign policies to control module/view access (see http://ez.no/community/forum/developer/limiting_within_viewlist_possible ). Of course, you can check in your fetch functions if the current user has the required policies to use the function.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Carlos Revillo

Thursday 22 December 2005 5:58:32 am

Thanks a lot. I was wrong about that but what you tell me is enough to solve my problem.

Yet another question related to roles. Let's see. I've created some content (folders, articles and custom content) as administrator. Late, I've created a new user in Editors Group. I logon into the admin interface with this new account and also can create new content and other things, but i can't find the way to edit content created by administrators... This contents does not appears in tree content, by the way. Is this possible?.

Thanks so much.

Kristof Coomans

Friday 23 December 2005 1:02:31 am

Do the users in the Editors group have permission to view the objects?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Carlos Revillo

Friday 23 December 2005 2:00:42 am

I give editors users access to all functions in content module.
but, as i said before, when i logon as editor i can't see content created by admins.
thanks.

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 20 2025 00:33:04
Script start
Timing: Jan 20 2025 00:33:04
Module start 'layout'
Timing: Jan 20 2025 00:33:04
Module start 'content'
Timing: Jan 20 2025 00:33:05
Module end 'content'
Timing: Jan 20 2025 00:33:05
Script end

Main resources:

Total runtime0.8832 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.0053 589.0313152.6094
Module start 'layout' 0.00530.0027 741.640639.4297
Module start 'content' 0.00800.8740 781.0703553.6953
Module end 'content' 0.88200.0012 1,334.765612.1875
Script end 0.8832  1,346.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3688160.0002
Check MTime0.00140.1533160.0001
Mysql Total
Database connection0.00090.100110.0009
Mysqli_queries0.838394.9158630.0133
Looping result0.00050.0582610.0000
Template Total0.852796.620.4264
Template load0.00170.198020.0009
Template processing0.851096.353320.4255
Template load and register function0.00010.016610.0001
states
state_id_array0.00120.131810.0012
state_identifier_array0.00080.090620.0004
Override
Cache load0.00140.1622200.0001
Sytem overhead
Fetch class attribute can translate value0.00060.064720.0003
Fetch class attribute name0.00100.116360.0002
XML
Image XML parsing0.00100.113320.0005
class_abstraction
Instantiating content class attribute0.00000.002170.0000
General
dbfile0.00090.0984160.0001
String conversion0.00000.000940.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/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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs