Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

permission view custom pages

jackmaessenjackmaessen ✭✭✭
edited April 2014 in Vanilla 2.0 - 2.8

Version: 2.0.18.10
I use the custompages plugin and in one of the pages, i want set the permission to view this page only for admin and Administrators.
I now have this line in the page:

if (!Gdn::Session()->CheckPermission('Plugins.Pockets.Manage')) return FALSE;

I noticed that it is now only viewable for the admin and not for those who have Administrator permissions.
How can i make this viewable for admin and Administrators?
(All checkboxes for the Administrator role are checked in Roles and Permissions)

Tagged:

Comments

  • peregrineperegrine MVP
    edited April 2014

    try

    $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
    if(!$IsAdmin) return;

    assuming only Admin role can edit users.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • solution found; line above must be this one:

    if (!Gdn::Session()->CheckPermission('Garden.Settings.Manage')) return FALSE;
    

    I tested the page with with normal member logged in and non logged in users and both could not see the page.

  • jackmaessenjackmaessen ✭✭✭
    edited April 2014

    @‌peregrine
    your solution also works fine, just tested it. Only visible for administrators. Thanks for support.

Sign In or Register to comment.