Fork me on GitHub

How to implement permission in my module.  Bottom

  • First in the pnversion.php

    Code

    $modversion['securityschema'] = array('pnGuildMgr::Guilds' => 'Guild ID:Guild Name:');


    Next in permissions

    Code

    HBarker pnGuildMgr::Guilds 2:: Edit


    And Finally in the template.

    Code

    <!--[ pnsecauthaction realm="0" comp="pnguildmgr::Guilds" inst="$guild.gid::" level="ACCESS_EDIT" assign="EditAccess"]-->

    <!--[if $EditAccess gt 0]-->
      Display edit related options here.
    <!--[/if]-->


    Does it look like I am missing anything? Something isn't quite correct as the HBarker account that I gave permissions to on GID 2 doesn't seem to get edit access.
  • Is $editAccess being assigned right? Can you make a test-registration to try it on? That's usually what I do.
  • this is how i check for admin in my module

    Code

    <!--[pnsecauthaction realm="0" comp="RiddimDB::" inst="::" level="ACCESS_ADMIN" assign="admin"]-->
    <!--[if $admin eq true]-->
    [<a href="<!--[pnmodurl modname="RiddimDB" type="admin" func="modify_song" sid=$sid]-->"><!--[pnml name="_EDIT"]--></a> |
    <a href="<!--[pnmodurl modname="RiddimDB" type="admin" func="delete_song" sid=$sid]-->"><!--[pnml name="_DELETE"]--></a>]
    <!--[/if]-->
  • why do u have gt as opposed to eq?

    thats the only thing i see can be wrong (i dont know if gt is a command?)
  • cannibus,

    LOL I dont know the first time I ever saw a verification for auth it was > 0 as apposed to =1 So Its just how I kept doing it.

    Figured it out though.
    when an assigned variable is in quotes I guess it doesn't pass the value or something I changed it to a concontenated variable and it worked fine.

    Code

    <!--[ pnsecauthaction realm="0" comp="pnGuildMgr::Guilds" inst=$guild.gid|cat:"::" level="ACCESS_EDIT" assign="EditAccess"]-->
  • ok, i always used =1.


    u learn something new everyday. (i think its time to read those Smarty documentations. )

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