View Permissions in new module extension

Author Message

anne martinet

Friday 25 July 2008 2:39:49 am

Hello,

I have an extension "helloworld", with a module helloworld and a view helloview.
In extension/helloworld/modules/helloworld/module.php I have initialised the module, the view, and I change permission. Like that:

<?php

$Module = array( 'name' => 'helloworld' );
$ViewList = array();
$ViewList["helloview"]=array(	"script"=>"helloview.php",
				"functions"=>array('read')  );
$FunctionList['read']=array();

?>

But this permission change nothing. The default permission stay. When I want access to my view (.../helloworld/helloview/) I could
login me. But I want to granted access to users anonymous.

What's wrong?

Thanks.

Bruce Morrison

Friday 25 July 2008 3:22:50 am

Hi Anne

You have 2 options:
1) Via Roles

Go into the admin -> User Accounts tab -> Roles and policies -> Anonymous -> Edit -> New Policy

You should see your module there, select that and Click on "Grant Access to one Function"

You should then see "read" in the Function dropdown, select this and "Grant Full Access"

2) via site.ini
[RoleSettings]
PolicyOmitList[]=helloworld/helloview
place this option in the extensions site.ini.append.php.

Note: This overrides any Role permissions and will grant access to all users, so be careful using this option.

HTH

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

anne martinet

Friday 25 July 2008 3:56:05 am

Thank you, for your answer.

But the solution that I use, doesn't work ?
It's not possible to give roles to a view, like I do?

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 18:27:14
Script start
Timing: Jan 18 2025 18:27:14
Module start 'layout'
Timing: Jan 18 2025 18:27:14
Module start 'content'
Timing: Jan 18 2025 18:27:15
Module end 'content'
Timing: Jan 18 2025 18:27:15
Script end

Main resources:

Total runtime0.6874 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.0469152.6406
Module start 'layout' 0.00540.0031 740.687539.4766
Module start 'content' 0.00840.6772 780.1641537.7500
Module end 'content' 0.68560.0017 1,317.914112.1250
Script end 0.6874  1,330.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4801160.0002
Check MTime0.00130.1895160.0001
Mysql Total
Database connection0.00080.122310.0008
Mysqli_queries0.635892.4883570.0112
Looping result0.00050.0698550.0000
Template Total0.658895.820.3294
Template load0.00220.323820.0011
Template processing0.656695.515820.3283
Template load and register function0.00030.048310.0003
states
state_id_array0.00140.196810.0014
state_identifier_array0.00070.101820.0003
Override
Cache load0.00190.2790310.0001
Sytem overhead
Fetch class attribute can translate value0.00080.115020.0004
Fetch class attribute name0.00090.132840.0002
XML
Image XML parsing0.00070.105120.0004
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00080.1156160.0000
String conversion0.00000.001240.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
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 7

Time used to render debug report: 0.0001 secs