Skip to content

Commit

Permalink
Merge pull request #2656 from QuizandSurveyMaster/CU-85ztkvkek-qsm-ul…
Browse files Browse the repository at this point in the history
…timate-hooks

Modify permissions for Editor role
  • Loading branch information
zubairraeen authored Oct 1, 2024
2 parents 2384a0a + fe96771 commit 3d3952f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ public function register_quiz_post_types() {
'edit_private_posts' => 'edit_private_qsm_quizzes',
'edit_published_posts' => 'edit_published_qsm_quizzes',
'create_posts' => 'create_qsm_quizzes',
'manage_categories' => 'manage_qsm_quiz_categories',
'manage_categories' => 'manage_qsm_quiz_answer_label',
'moderate_comments' => 'view_qsm_quiz_result',
);

Expand Down Expand Up @@ -705,6 +703,12 @@ public function register_quiz_post_types() {
'show_in_rest' => true,
'show_tagcloud' => false,
'rewrite' => false,
'capabilities' => array(
'manage_terms' => 'manage_qsm_quiz_categories',
'edit_terms' => 'edit_qsm_quiz_categories',
'delete_terms' => 'delete_qsm_quiz_categories',
'assign_terms' => 'assign_qsm_quiz_categories',
),
);
register_taxonomy( 'qsm_category', array( 'qsm-taxonomy' ), $taxonomy_args );
}
Expand All @@ -725,16 +729,22 @@ public function qsm_add_user_capabilities() {
'manage_qsm_quiz_categories',
'manage_qsm_quiz_answer_label',
'view_qsm_quiz_result',
'edit_qsm_quiz_categories',
'assign_qsm_quiz_categories',
'delete_qsm_quiz_categories',
);
$editor_capabilities = array(
'publish_qsm_quizzes',
'edit_published_qsm_quizzes',
'edit_others_qsm_quizzes',
'delete_published_qsm_quizzes',
'delete_qsm_quiz',
'delete_qsm_quizzes',
'manage_qsm_quiz_categories',
'manage_qsm_quiz_answer_label',
'view_qsm_quiz_result',
'edit_qsm_quiz_categories',
'assign_qsm_quiz_categories',
);
$author_capabilities = array(
'edit_published_qsm_quizzes',
Expand Down

0 comments on commit 3d3952f

Please sign in to comment.