Page MenuHomeSealhub

Policies - add .getDescription() method
Open, NormalPublic1 Points

Description

Add a getDescription() : string method to Policy class. It should return a human-readable description of the policy.

For example, new Policies.LoggedIn().getDescription() could return "You can access this only if you are logged in."

This also need to handle cases where we build more complex policies out of simpler ones. So for example new Policies.Not(new Policies.LoggedIn()).getDescription() should return "You cannot access this if you are logged in".

In order to achieve this modularity, it's best to have two additional methods:

  • getPartialPositiveDescription() that only answers the question "why can you access this? Because..." - for LoggedIn, it should return "you are logged in".
  • getPartialNegativeDescription() that only answers the question "why are you forbidden from accessin this? Because..." - for LoggedIn, it should return "you are not logged in".

Event Timeline

kuba-orlik added a subscriber: krzysztof.
ziomek updated Coded by, added: ziomek.
ziomek removed ziomek as the assignee of this task.Thu, Aug 21, 17:02
ziomek updated Coded by, removed: ziomek.
ziomek updated Action required from, removed: ziomek.
ziomek subscribed.
jenkins-user updated Coded by, added: ziomek.
jenkins-user updated Action required from, added: ziomek.
ziomek removed ziomek as the assignee of this task.Thu, Aug 21, 17:07
ziomek moved this task from Doing to To do on the Kanban board.
ziomek updated Coded by, removed: ziomek.
ziomek updated Action required from, removed: ziomek.
ziomek unsubscribed.