Support » Plugin: ACF User Role Field Setting » Super Admins and DISALLOW_FILE_MODS

  • Hi there,

    We’d like to use your handy little plugin to restrict some fields to only super_admins on MultiSite. Unfortunately, the way your plugin currently checks if someone is a super_admin is incompatible with our configuration, and I believe could be easily resolved within the plugin.

    We manage our sites’ code with version control, so have set DISALLOW_FILE_MODS to be true:

    Editing wp-config.php

    Your plugin uses the following to determine if a user is a super admin:
    if (is_multisite() && current_user_can(‘update_core’)) {
    $this->current_user[] = ‘super_admin’;

    which is NOT true even for network administrators when DISALLOW_FILE_MODS is set to true.

    Might you consider using something such as current_user_can(‘manage_network’) or explicitly checking the wp_sitemeta table for who the super users are instead?

    Cheers and thanks

    – Jason

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Huebner


    I don’t currently have a multisite running that I can test this on. Have you tried updating the if statement to use “manage_network”. If you have not, can you try altering the if statement and let me know if that works. Otherwise I’m going to need to set up a site just to test it out and that could take me some time. It looks like it should but I don’t want to make a change without testing.

    I have replaced update_core with ‘manage_network’ and it works as expected. Network admins can still access the field, while others cannot.

    Plugin Author John Huebner


    change has been made and new version pushed to SVN

    Works great – thank you so much for the incredibly quick response!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Super Admins and DISALLOW_FILE_MODS’ is closed to new replies.