Skip to content

Commit

Permalink
Merge pull request #2126 from CityOfPhiladelphia/fix/multi-department
Browse files Browse the repository at this point in the history
Correct operator to allow both 'multi-department access or all-depart…
  • Loading branch information
m-atia authored May 9, 2024
2 parents 3b6782c + adfde65 commit a014ce3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jQuery(document).ready(function($){
}

//Force top category to be checked all the time, unless the user has access to mutiple categories
if( !phila_WP_User.includes('multi_department_access') && !phila_WP_User.includes('secondary_all_departments')) {
if( !phila_WP_User.includes('multi_department_access') || !phila_WP_User.includes('secondary_all_departments')) {
var required_cat = $('#categorychecklist > li:first-child input');
if( !required_cat.attr('checked') ) {
required_cat.attr('checked','checked');
Expand Down Expand Up @@ -126,10 +126,10 @@ jQuery(document).ready(function($){
$('#phila_template_select option').each( function () {
if( $(this).val() !== '' && $(this).val() !== 'post' ){
$(this).css('display', 'none');
}
}
});
//ensure users who only have access to posts get the option preselcted for them
if (!phila_WP_User.includes('secondary_press_release_editor') &&
if (!phila_WP_User.includes('secondary_press_release_editor') &&
!phila_WP_User.includes('secondary_press_release_contributor') &&
!phila_WP_User.includes( 'secondary_action_guide_editor' )){
$("#phila_template_select").val('post');
Expand All @@ -142,7 +142,7 @@ jQuery(document).ready(function($){
}
});
}

if( phila_WP_User.includes( 'secondary_action_guide_editor' ) ) {
$('#phila_template_select option').each( function () {
if( $(this).val() === 'action_guide' ){
Expand Down

0 comments on commit a014ce3

Please sign in to comment.