Fork me on GitHub

pnSecAuthAction replacement?  Bottom

  • Hi all, apparently, pnSecAuthAction() has been taken away, is there a new way to check for permissions in the code?
  • Hi,

    you can use SecurityUtil::checkPermission'Modul', Instance, ACCESSRIGHTS) which does what the pnsecauthaction did.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Hi, it seems a part of your reply is missing?
  • Looks like his answer is complete. Here is a code sample if it helps.

    Code

    if (!SecurityUtil::checkPermission('StrainID::', "::", ACCESS_EDIT)) {
            LogUtil::registerError( _MODULENOAUTH);
            return false;
    }
  • thank you - I was wondering because of the parenthesis on the right
  • I missed a parenthesis indeed icon_wink I thought that would go unnoticed icon_smile
    BTW Also in the templates you can use the securityutil statement.
    For example:

    Code

    <!--[securityutil_checkpermission component='Stories::Story' instance='::' level='ACCESS_EDIT' assign='authedit']-->

    You can then use the authedit variable in the template to check for editing rights.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Okay, so I'm trying to work with this now...
    I'm running 1.2.1 & pagemaster .4-RC1
    In the template to display the publication I have

    Code

    <!--[securityutil_checkpermission comp="pagemaster::" inst="$core_tid:$core_pid:" level=ACCESS_EDIT assign="perm"]-->
    <!--[if $perm]--><br />
    <a href="<!--[pnmodurl modname='pagemaster' func='pubedit' tid=$core_tid pid=$core_pid]-->&goback=1"><!--[gt text='Edit This']--></a>
    <!--[/if]-->


    I have the 2nd permission (first under admin) as

    Staff pagemaster:: pagemaster:: .* .* Edit access

    I have the user in the staff group

    I, as admin can see the edit link and it works. Staff doesn't see it.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • The parameters should be written out completely, so component and instance and not abbreviated as far as I can see in the code.



    edited by: espaan, datetimebrief

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Change it, edit still not showing to staff.

    Code

    <!--[$body|pnvarprephtmldisplay]-->

    <!--[securityutil_checkpermission component="pagemaster::" instance="$core_tid:$core_pid:" level=ACCESS_EDIT assign="perm"]-->
    <!--[if $perm]--><br />
    <a href="<!--[pnmodurl modname='pagemaster' func='pubedit' tid=$core_tid pid=$core_pid]-->"><!--[gt text='Edit This']--></a>
    <!--[/if]-->




    edited by: HalbrookTech, datetimebrief

    --
    Home Page | Find on Facebook | Follow on Twitter
  • BAH Chrome evidently logged my staff user account out. Need to put a Staff menu together I think, at least that way I have a visual cue in the menu that the staffer isn't logged in.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Hehehehe
    or just a theme note on the top icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • nestormateo

    Hehehehe
    or just a theme note on the top icon_wink

    Yeah, that's not gonna work so well, if I do that, then they'll get confused. Now if I could just do in-line editing like in news, it'd be even better for them, then the page doesn't change.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Quote

    at least that way I have a visual cue in the menu that the staffer isn't logged in.

    I meant, to know who's logged in icon_razz

    --
    - Mateo T. -
    Mis principios... son mis fines

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