Commit Graph

8 Commits

Author SHA1 Message Date
David Mudrák
222c378870 MDL-62309 tool_policy: Amend behaviour of handler's accept() method
When accepting the policies via the sitepolicy handler, only compulsory
policies are to be marked as accepted. Optional policies will be left as
pending. Users must express their consent explicitly for them.

As a side product of the change, unit tests are added for the whole
handler class.
2018-10-22 08:49:36 +02:00
David Mudrák
ad5e2135c5 MDL-62309 tool_policy: Improve permission evaluation methods
Please refer to the unit tests for the specification of the expected
behaviour.
2018-10-22 08:49:36 +02:00
David Mudrák
faf4222edc MDL-62309 tool_policy: Add api::get_agreement_optional() method
This method allows to quickly check if the given policy version is
marked as optional or compulsory. This will be needed in other places
such as permissions check.
2018-10-22 08:49:36 +02:00
David Mudrák
1617fde9a8 MDL-62309 tool_policy: New API method to decline a policy
Policy can be declined. Optional policies do not need to be accepted to
use the site. But we still want to hear explicitly from the user.
2018-10-22 08:49:36 +02:00
David Mudrák
f98cd91a13 MDL-62309 tool_policy: Improve api::is_user_version_accepted() return
The method now returns three-state logic. A bool value true/false is
returned if the user has accepted/rejected the policy, respectively. A
null value is returned if the user did not express their agreement in
either way yet.

This allows to distinguish between "rejected the policy" and "did not
say anything about it yet" cases.
2018-10-22 08:49:36 +02:00
Sara Arjona
461b1931c0 MDL-62062 tool_policy: Let manager/dpo withdraw consent to policies
The policies can be revoked by clicking the "Agreed [on behalf]" ticks.
A message has been added also to explain users they must contact to
the DPO if they want to withdraw their consent to policies.
2018-05-07 10:11:13 +02:00
Sara Arjona
4e9e2b0a0a MDL-61844 policy: Avoid to accept new policies during current session
Avoid redirection for accepting new policies during the manager user session
when $user->policyagreed=0 and he/she activates the first policy for logged in users.

Part of MDL-61864
2018-04-16 11:30:14 +08:00
David Mudrák
3d9571d5f0 MDL-61864 tool_policy: management of the site policies 2018-04-16 11:30:10 +08:00