Is there a way to do Permissions checks in a Template? say, if access read display this, if not display this. And/or a way to do it based on a group?
--
Home Page | Find on Facebook | Follow on Twitter
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnRender Template & Permissions
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
-
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Yes, the pnSecAuthAction API is implemented as a plugin, I just cant remember the syntax...
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
I think I saw that, but wanted to make sure I was thinking right about it.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Well, I see the syntax, just gotta look in to how to get the info from it it appears.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
What I'm trying to do is create a set up where a certian part of a Pagesetter template will only show to the Premium Group.. If I'm understanding right, I can use this to do that.
I can create, say a component "Premium" and set a permission up for it
Code
Premium | Premium:: | .* | Read
All users | Premium:: | .* | Overview
Code
<!--[pnsecauthaction realm="0" comp="Premium::" inst=".*" level="ACCESS_READ" assign="premium"]-->
and then use
Code
<!--[if $premium]--> show premium content <!--[else]-->Show add pitch to buy Premium<!--[/if]-->
Am I understanding it right? I tried it, and it seems to basically work, but I seem to be having problems, I'm guessing related to caching. However, I've got Caching turned off in pnRender and it's still seeming to do it wrong. If I view the pub as a Premium member, and force a reload, I get everything, but then if I look at it as a non-Premium, I still see the whole thing, but if I force, then I get what I should get, but the premium account sees the restricted view. I tried putting around the template, but didn't seem to help. Am I at least barking up the right tree?
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
That looks good from my angle - though the instance should perhaps be :: ?
You could try using the Pagesetter link to clear the cache, rather than the pnRender one (I don't know if there is a difference)
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Code
<!--[pnsecauthaction realm="0" comp="IPPremium::" inst=".*" level="ACCESS_READ" assign="auth"]-->
<h1><!--[$Title]--></h1>
<i><!--[$Byline]--></i><br />
<hr>
<!--[$Teaser]--><br />
<!--[nocache]-->
<!--[if $auth]-->
<!--[$body]--><br />
<!--[/if]-->
<!--[if not $auth]-->
To view the rest of this article and other Premium content, please <a href="/agilebill/">Sign up for a trial subscription</a>.
<!--[/if]-->
<!--[/nocache]-->
<hr>
<i><!--[$Bio]--><br /></i>
<!--[$core.printThis]--> | <!--[$core.sendThis]--> | $editThis$
What am I missing? It almost seems to be working, but I have a Premium user open in FireFox and a regular in IE and both are seeing the same thing. The Restricted view.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Ah, not missing anything, Pagesetter doesn't play right with nocache or with the pnRender don't cache setting.
--
Home Page | Find on Facebook | Follow on Twitter
- Moderated by:
- Support
