Assigning policies on the fly in a session

Author Message

Clemens T

Tuesday 18 April 2006 5:23:00 am

Heya all,
I'd like an anonymous user to get a temporary window to read a file on my site. I believe the most elegant way to do it is to temporarily 'give' the user a policy which is saved in his session.

Any thought/ideas/helpful comments?

Thanks a lot,
Clemens

Clemens T

Tuesday 25 April 2006 1:45:27 pm

Anyone?

Kristian Hole

Tuesday 25 April 2006 10:43:12 pm

You could make a module in an extension which switches eZ publish user for that user when accessed. (Or even a template operator)

Module tutorial here:
http://ez.no/products/ez_publish/documentation/development/extensions/module/module_tutorial_part_1

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Kristof Coomans

Tuesday 25 April 2006 11:41:01 pm

Policies of the current user are cached inside the AccessArray session variable, so you can change that on the fly.

Interesting approach... Can you post your solution when it's ready? :)

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

Clemens T

Wednesday 26 April 2006 3:39:00 pm

Thanks Kristof, I got a lead now... will get back if I get some sort of solution.

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 19 2025 00:57:01
Script start
Timing: Jan 19 2025 00:57:01
Module start 'layout'
Timing: Jan 19 2025 00:57:01
Module start 'content'
Timing: Jan 19 2025 00:57:02
Module end 'content'
Timing: Jan 19 2025 00:57:02
Script end

Main resources:

Total runtime0.8580 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.2891152.6406
Module start 'layout' 0.00500.0026 741.929739.4766
Module start 'content' 0.00760.8487 781.4063595.1953
Module end 'content' 0.85630.0017 1,376.601612.1250
Script end 0.8580  1,388.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4612160.0002
Check MTime0.00180.2089160.0001
Mysql Total
Database connection0.00070.079410.0007
Mysqli_queries0.792492.3565650.0122
Looping result0.00080.0958630.0000
Template Total0.813694.820.4068
Template load0.00220.251020.0011
Template processing0.811494.565220.4057
Template load and register function0.00020.018110.0002
states
state_id_array0.00080.093610.0008
state_identifier_array0.00130.150220.0006
Override
Cache load0.00180.2100210.0001
Sytem overhead
Fetch class attribute can translate value0.00250.285730.0008
Fetch class attribute name0.00150.171670.0002
XML
Image XML parsing0.00350.407930.0012
class_abstraction
Instantiating content class attribute0.00000.002170.0000
General
dbfile0.00400.4643220.0002
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
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/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: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs