Okay
  Public Ticket #2178366
Only Admin Allowed to Edit
Open

Comments

  •  3
    Mark D Gillette started the conversation

    I see the selection in a new project to Allow Only the Author to Edit the Project, but what if I only want an Admin to be able edit the Project?

    Thanks

  •  631
    François replied

    Admins should be able to edit projects by default, otherwise we can show you how to override the function that handles this. It's one function for all posts, so you can simply say: 

    if user = admin -> edit = true

    Keep us posted

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  3
    Mark D Gillette replied

    That is what I want. What if I don't want the author to be able to edit after he enters in the new project info.

  •  292
    Abhishek replied

    You can use the function below to do so

    add_filter( 'woffice_user_can_delete_project', 'woo_project_delete' );
    function woo_project_delete( ) {
        if ( current_user_can('administrator') ) {
            return true;
        }
        return false;
    }

    Hope this helpssmile.png

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  •  3
    Mark D Gillette replied

    Awesome! So if I only want the Admin to be able to change/edit project I would replace the "delete" with "edit"?

    THanks

  •  292
    Abhishek replied

    Yeah you can do this

    add_filter( 'woffice_current_user_can_edit_project', 'woo_project_delete' );
    function woo_project_delete( ) 
    {    if ( current_user_can('administrator') ) {
            return true;
        }
        return false;
    }

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.