Skip to content
Permalink
Browse files

999: Fix wrong permissions error messages. (#1005)

Fixes #999.

Corrections made according `Sorry, you are not allowed to create/edit/delete this note.` pattern mentioned in #999.
  • Loading branch information...
pedro-mendonca authored and ocean90 committed Apr 5, 2019
1 parent db74c83 commit 88da4ba9f18df9b1c946821c1f969866cd65c3ce
Showing with 3 additions and 3 deletions.
  1. +3 −3 gp-includes/routes/note.php
@@ -28,7 +28,7 @@ public function new_post() {
$admin = GP::$permission->current_user_can( 'approve', 'translation', $translation_id, array( 'translation' => $translation ) );
if ( get_current_user_id() !== (int) $translation->user_id && ! $admin ) {
return $this->die_with_error( __( 'You don\'t have permissions. Please try again.', 'glotpress' ), 403 );
return $this->die_with_error( __( 'Sorry, you are not allowed to create this note.', 'glotpress' ), 403 );
}
if ( ! $this->verify_nonce( 'new-note-' . $translation_id ) ) {
@@ -59,7 +59,7 @@ public function edit_post() {
$admin = GP::$permission->current_user_can( 'approve', 'translation', $translation_id, array( 'translation' => $translation ) );
if ( get_current_user_id() !== (int) $note_object->user_id && ! $admin ) {
return $this->die_with_error( __( 'You don\'t have permissions. Please try again.', 'glotpress' ), 403 );
return $this->die_with_error( __( 'Sorry, you are not allowed to edit this note.', 'glotpress' ), 403 );
}
if ( ! $this->verify_nonce( 'edit-note-' . $note_id ) ) {
@@ -88,7 +88,7 @@ public function delete_post() {
$admin = GP::$permission->current_user_can( 'approve', 'translation', $translation_id, array( 'translation' => $translation ) );
if ( get_current_user_id() !== (int) $note_object->user_id && ! $admin ) {
return $this->die_with_error( __( 'You don\'t have permissions. Please try again.', 'glotpress' ), 403 );
return $this->die_with_error( __( 'Sorry, you are not allowed to delete this note.', 'glotpress' ), 403 );
}
if ( ! $this->verify_nonce( 'delete-note-' . $note_id ) ) {

0 comments on commit 88da4ba

Please sign in to comment.
You can’t perform that action at this time.