Fork me on GitHub

Pagemaster/Clip - different input permissions?  Bottom

  • I want to create different input templates, so that user A cann edit the whole publication,but user B only a few fields within the template edit_all.

    Is this possible and how do I get this to work?

    Zikula 1.2.4 - pagemaster 0.42



    Edited by frw on Oct 03, 2010 - 09:31 PM.
  • I don't know any PageMaster specific function, but for a small group of defined user, I would simply enclose the restricted fields using a condition:

    Code

    <!--[pnusergetvar name='uname' uid=$uid assign='uname']-->
    <!--[if $uname eq 'frw' OR $uname eq 'frw1']-->
       my fields
    <![/if]-->


    If there are a lot of people I would probably use Zikula groups.
    Hope it helps,
    Philippe
  • Thanks, but the group of user isn't very small, so an special input template only with a part of fields would be better.
  • If the users are part of a group, give them 'delete' acces

    Code

    <!--[pnsecauthaction_block component='pagemaster:input:' instance="$pubtype.tid::" level=ACCESS_DELETE]-->
    Your Fields
    <!--[/pnsecauthaction_block]-->

    or maybe another option

    Code

    <!--[pnmodapifunc modname="Groups" type="user" func="getusergroups" uid=$uid assign="usergroups"]-->
    <!--[foreach item="group" from=$usergroups]-->
        <!--[if $group.gid eq 3]--> Your Field<!--[/if]-->
    <!--[/foreach]-->
    where the group.gid is the number of the users who have access....

    - Igor
  • Well
    the input has different templates per workflow states but no alternatives like the lists or display. So, you need permissions checks on the same template. pnsecauthaction_block seems to be the best choice IMO.

    You also probably need to extend the permission component.
    PageMaster uses this permission check:

    Code

    pagemaster:input: | tid:pid:state


    Try to disable the access to the group B to this component:

    Code

    Group B | pagemaster:input:sectionA | * | None

    then use in your edit_all template:

    Code

    <!--[pnsecauthaction_block component='pagemaster:input:sectionA' instance="$pubtype.tid::" level=ACCESS_EDIT]-->
        Group A Fields
    <!--[/pnsecauthaction_block]-->


    --
    - Mateo T. -
    Mis principios... son mis fines
  • Thanks to all, the solution with the permissions works fine.

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