• Resolved RS

    (@rsdotscot)


    Hi folks,

    I hope you’re all well and ready for your respective festivities and the new year πŸ™‚

    I doubt this will get any attention in the short term given the time of year but there’s no rush.

    I have certain admin users who I’d like to hide certain options panels from. For talking sake let’s call these users normal admins and the options panel is the super admin only panel.

    So far I’ve been able to determine that disabling sets and/or fields results in data being lost (everything in the super admin only panel) when an admin who a boolean test has determined is a normal admin goes into the options and clicks ‘save’. Obviously not ideal, so I’m trying another route whereby I hide that particular panel using some simple jQuery (loaded via the admin_footer hook) to remove its li.redux-group-tab-link-li as well as the submenu item on the left (via the custom_menu_order hook). The jQuery simply targets the span with the set name then goes up two parents (to the li) before removing it from the DOM.

    Going the jQuery route is maintaining the data in the super admin only panel, but it’s got a quirk where if I navigate from one set to another and back the options have all disappeared and the page needs to be refreshed to bring them back.

    I’m not looking to have you debug the tiny bit of code I’ve written, but I’m wondering if you might have an alternative suggestion which might alleviate the disappearing options quirk. Any ideas?

    All the best to you and yours πŸ™‚

    Cheers,
    RS

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter RS

    (@rsdotscot)

    Actually, my mistake. It seems that setting show_import_export to false is what was causing the quirk. It’s not clear why that might be.

    Plugin Author Kev Provance

    (@kprovance)

    Thread Starter RS

    (@rsdotscot)

    Hi Kev,

    Thanks for getting back to me so quickly πŸ™‚

    I’ve created a custom capability and set the permissions field for the set and the fields and it gets me part of the way towards where I need to be. It removes the set from the main admin menu, but it’s still in the Redux menu on the options pages, and it removes the fields from the set page, so that’s good. It’s almost where I need it to be πŸ™‚

    For the moment I’ll stick with my hacky workaround until a future update takes care of the Redux menu issue.

    Is there a way to apply the same functionality to the import/export screen? This is important because someone with some technical knowledge could export the data, update it, then import it back in, thus bypassing the permissions.

    I hope you and yours have a great new year πŸ˜€

    Cheers,
    RS

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hiding a panel from certain users’ is closed to new replies.