Fork me on GitHub

pnRender Template & Permissions  Bottom

  • 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
  • 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
  • I think I saw that, but wanted to make sure I was thinking right about it.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • 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
  • 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
  • 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
  • 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
  • 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

This list is based on users active over the last 60 minutes.