I had no problem until I working with my localhost. After uploading, I was able to edit css files but not php files. after a lot of research, I found problem source is enabling HTTPS protocol. I changed url to normal HTTP and everything was good.
After some research, finally enabling openssl extension in php.ini file, resolved my probleem
I believe with the help of remove_post_type_support you can achieve this. But first you need to keep an user meta with the list of posts IDs he/she will be able to edit. And you can achieve this with this below function-
update_user_meta( $user_id, $meta_key, $meta_value, $prev_value )
So whenever a post will be loaded you can check the array of editable ...