-
Notifications
You must be signed in to change notification settings - Fork 10
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
consent property 'flag' ambigious #23
Comments
@rockxwre
ConsentCookie.getConsent works as the the deprecated ConsentCookie.get with some minor changes
isAccepted() // If the user has accepted the consent
isAlwaysOn() // If the consent is always on (and cannot be changed by the user)
isEnabled() // If the consent is accepted by the user or is always on
isRejected() // If the consent has not been accepted by the user
ConsentCookie.getConsents is new and is based on calling the deprecated ConsentCookie.get without an id arguement.
get($id) // Works the same as calling ConsentCookie.get
getConsentMap // Will give a map of all configured consents with the key the id of the consent and the value a Consent object
getCookieValues // The ConsentCookie values not filtered by the configuration mapped by key = id and value = consent flag Could you comment on this update related to the requested changes. |
Test resultsI tested it using the browsers Console. Everything works as described, which is great! isAcceptedI read some GDPR documentation and in this documentation the verb 'grant' is used in this context. You grant or reject a consent. So maybe isAlwaysOnIn line with my previous comment (isAccepted), a consent cannot be 'on' or 'off'. In this case you have no choice. You are forced to grant the consent. Maybe something like isEnabledThis one confused me the most. Since consent toggles can be immutable, my first guess was that if isRejectedThis one is in line with my previous comments. |
Description
With
ConsentCookie.get("<app id>")
you will get an object that represents a consent.This object will have a property called
flag
. Like stated in the documentation the value 0 represents a disabled (rejected?) consent and the value 1 represents an enabled (granted?) consent.I think the term flag is ambiguous.
Expected Behavior
In my opinion, it would be better to have this
flag
property only for internal use and backward compatibility.Instead, functions like:
ConsentCookie.isGranted("<app id">)
ConsentCookie.isRejected("<app id">)
ConsentCookie.get("<app id>").isGranted()
ConsentCookie.get("<app id>").isRejected()
will be more intuitive to use.
The text was updated successfully, but these errors were encountered: