• Resolved vcugreg

    (@vcugreg)


    We have a member page that only “subscribers” and “admins” are able to access. On this page is a button using the [export-users] shortcode. It works perfectly for admins that navigate to this member page and click the button, but normal users get this error and the page doesn’t load fully:

    “Only users who are able to create users can export them.”

    It is specifically this shortcode causing the problem. Is there a way to allow any user the ability to export our user list and not just admins? It appears that the only people able to export the user list are admins, currently. Thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Javier Carazo

    (@carazo)

    When you export users, you may see confidential data (like passwords).

    Anyway, you can manage it using this: apply_filters( ‘acui_capability’, ‘create_users’ )

    To change the capability we manage.

    Thread Starter vcugreg

    (@vcugreg)

    Thank you for the response. Could you please be very specific and tell me the script and where to place it on the wordpress site? I have hidden the password value from the excel export file (so it is safe enough for us). Thank you in advance.

    Plugin Author Javier Carazo

    (@carazo)

    Sorry I cannot make custom code for you… but you could add to your functions.php something like:

    add_filter( 'acui_capability', function(){ return 'here_the_capability_you_need'; )

    You will know which capability you want to set there.

    Thread Starter vcugreg

    (@vcugreg)

    Respectfully, I’m not asking you to create custom code. I just want the export feature you already have to allow all users to export the list. Would this not just require editing your current code from allowing only admins to allow all? Thank you for your time.

    Plugin Author Javier Carazo

    (@carazo)

    When exporting users you can obtain sensitive information from all of them, therefore, by default and because not doing so would be a very serious security issue, only roles that have the ability to create users can do so. The administrator role, by default, has it.

    You can read about roles and capabilities here: https://ww.wp.xz.cn/support/article/roles-and-capabilities/

    For that reason, only roles that have that capability can do this. Even so, knowing that there are specific situations where it may make sense that another type of role with other capabilities, we offer that hook that I mentioned before so you can do what you need: acui_capability.

    This is a filter hook, not an action one.

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

The topic ‘Front End Export Users Button Error’ is closed to new replies.