Add user n1njawtf
to group www-data
(see: http://superuser.com/questions/95972/how-do-i-add-a-user-to-multiple-groups-in-ubuntu). In the case, you can edit files.
Also you can change umask to 000, to allow edit files by any user (but it not recommended for public servers). See: http://devdocs.magento.com/guides/v2.0/install-gde/install/post-install-umask.html