TheExpanding on the other answers are fine. Based on these, here is a piece of Elisp, allowing to automate this action:
(defun chmod-this-file () "chmod the file corresponding to the current buffer." (interactive) (setq modes (read-file-modes "File modes (octal or symbolic): " buffer-file-name)) (chmod buffer-file-name modes))