• Resolved abdobasha2004

    (@abdobasha2004)


    Hello,

    Great product BTW.

    I need to allow “Author” level to use image generator.

    Is there an easy way to do it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @abdobasha2004,

    Currently, the only way to do this would be to give access to all the screens (except the Settings, which are only for the Administrators). I have a WordPress filter called “mwai_allow_usage” you can hook into, and you can return true if the current user is a standard user. That would work ??

    In the plugin, you can see that hook implemented in the core.php file, in the can_access_features function.

    Thread Starter abdobasha2004

    (@abdobasha2004)

    I am sorry I am lost here.

    Can you please give me the code to put in functions.php?

    Or you mean I should edit the file of the plugin core.php?

    Thank you so much.

    Thread Starter abdobasha2004

    (@abdobasha2004)

    I tried this code in functions.php but did not work!

    
    function allow_standard_users_to_use_plugin( $allow_usage ) {
        if ( current_user_can( 'author' ) ) {
            return true;
        }
        return $allow_usage;
    }
    add_filter( 'mwai_allow_usage', 'allow_standard_users_to_use_plugin' );
    

    Am I missing something?

    Plugin Author Jordy Meow

    (@tigroumeow)

    Can you try to add it through the Code Snippets plugin? I had feedback from some of my users that it worked better with it (it might be that the functions.php might be ran too late or too early, I am not sure)

    Thread Starter abdobasha2004

    (@abdobasha2004)

    I tried code snippet too, unfortunately not working :/

    Azhar Khan

    (@officialazhark)

    The snippet works, just make sure to use it in a plugin. Either create a new plugin and run it, so it can be trigged very early.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Multi Author Blog, how to give permissions for AI Generated images’ is closed to new replies.