Skip to content

Commit

Permalink
Merge pull request #8504 from CitizenLabDotCo/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
luucvanderzee authored Jul 29, 2024
2 parents 7555810 + 692d98c commit 2529db3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 0 additions & 4 deletions back/app/services/permissions/base_permissions_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,5 @@ def user_denied_reason(permission, scope = nil)
def denied_when_permitted_by_groups?(permission)
permission.permitted_by == 'groups' && permission.groups && !user.in_any_groups?(permission.groups)
end

def user_requirements_service
@user_requirements_service ||= Permissions::UserRequirementsService.new(check_groups: false)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def create?
return false unless user&.active?
return false unless record.user_id == user.id

reason = Permissions::ProjectPermissionsService.new.denied_reason_for_action 'volunteering', user, record.cause.phase.project
project = record.cause.phase.project
service = Permissions::ProjectPermissionsService.new(project, user)
reason = service.denied_reason_for_action('volunteering')
return false if reason

ProjectPolicy.new(user, record.cause.phase.project).show?
Expand Down
2 changes: 2 additions & 0 deletions front/app/translations/admin/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.takingPoll": "<b>Taking poll:</b> {participants}",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.takingSurvey": "<b>Taking survey:</b> {participants}",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.usersWithConfirmedEmail": "Users with confirmed emails",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.volunteering": "<b>Volunteering:</b> {participants}",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.volunteeringPhase": "Volunteering phase",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.voting": "<b>Voting:</b> {participants}",
"app.components.app.containers.AdminPage.ProjectEdit.phaseHeader.votingPhase": "Voting phase",
Expand Down Expand Up @@ -2150,6 +2151,7 @@
"app.containers.AdminPage.groups.permissions.permissionAction_submit_input_subtitle": "Who can submit inputs?",
"app.containers.AdminPage.groups.permissions.permissionAction_take_poll_subtitle": "Who can take the poll?",
"app.containers.AdminPage.groups.permissions.permissionAction_take_survey_subtitle": "Who can take the survey?",
"app.containers.AdminPage.groups.permissions.permissionAction_volunteering_subtitle": "Who can volunteer?",
"app.containers.AdminPage.groups.permissions.permissionAction_vote_proposals_subtitle": "Who can vote on proposals?",
"app.containers.AdminPage.groups.permissions.permissionAction_voting_subtitle": "Who can vote?",
"app.containers.AdminPage.groups.permissions.phase": "Phase",
Expand Down
6 changes: 6 additions & 0 deletions front/app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,12 @@
"app.utils.actionDescriptors.attendingEventNotPermitted": "You are not permitted to attend this event.",
"app.utils.actionDescriptors.attendingEventNotSignedIn": "You must log in or register to attend this event.",
"app.utils.actionDescriptors.attendingEventNotVerified": "You must verify your account before you can attend this event.",
"app.utils.actionDescriptors.volunteeringMissingRequirements": "You must complete your profile to volunteer.",
"app.utils.actionDescriptors.volunteeringNotInGroup": "You do not meet the requirements to volunteer.",
"app.utils.actionDescriptors.volunteeringNotPermitted": "You are not permitted to volunteer.",
"app.utils.actionDescriptors.volunteeringNotSignedIn": "You must log in or register to volunteer.",
"app.utils.actionDescriptors.volunteeringNotVerified": "You must verify your account before you can volunteer.",
"app.utils.actionDescriptors.volunteeringdNotActiveUser": "Please {completeRegistrationLink} to volunteer.",
"app.utils.errors.api_error_default.in": "Is not right",
"app.utils.errors.default.ajv_error_birthyear_required": "Please fill in your year of birth",
"app.utils.errors.default.ajv_error_date_any": "Please fill in a valid date",
Expand Down

0 comments on commit 2529db3

Please sign in to comment.