Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMB-272: Add Validity Dates Check For Certificate Download #81

Merged

Conversation

shahrukh-compuco
Copy link
Contributor

@shahrukh-compuco shahrukh-compuco commented Nov 6, 2023

Overview

Add checks for validity dates during the certificate download i.e if contacts membership is valid between the min and max validity dates then only the certificate gets downloaded otherwise an error message is shown to the user.

Before

N/A

After

The check works in following ways

  1. If the membership start date is before or equal (<=) to the “Max Valid Through Date” of the certificate then the user should have access. Otherwise deny access. If the Max Valid Through Date is null, this test can be disregarded.

AND

  1. If the membership end date is after or equal (>=) the “Min Valid From Date “ , the user should have access to the certificate. Otherwise deny access. If the Min Valid From Date is null, this test can be disregarded.

@olayiwola-compucorp
Copy link
Contributor

olayiwola-compucorp commented Nov 24, 2023

@shahrukh-compuco; I dont think this check checkMembershipDates() is needed.

The system should work in such a way that if the membership date does not meet the expected criteria, the user won't get the link at all.

You can simply see how we check for conditions like membership status here https://github.com/compucorp/uk.co.compucorp.certificate/blob/13e662cfe0c0424b929782fd7512e7ebc444ced0/CRM/Certificate/Entity/Membership.php#L132C3-L132C102

@shahrukh-compuco shahrukh-compuco merged commit 31c2d35 into MMB-78-workstream Nov 27, 2023
2 checks passed
@shahrukh-compuco shahrukh-compuco deleted the MMB-272-restrict-certificate-access branch November 27, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants