The 'roles' facility is important to the complete Drupal system in that it is used to control who does what.

As far as the Ubercart module is concerned, three things are important:

  1. For a person to control the Store module, they need to be given the role 'shop manager'
  2. We use Ubercart's ability to assign a role to the user who purchases a product to assist in the administration of OpenVPMS Subscriptions
  3. We use the Ubercart Alt Discount module's ability to set a discount if the user has a specific role

Thus, we have created the role 'Subscriber' (via http://www.openvpms.org/admin/user/roles ) which is assigned to the user when they purchase their subscription, is set to expire in 1 year, and has an 'expiry warning' time of 1 month (set via http://www.openvpms.org/admin/store/settings/products/edit/features ).

We have also created the role 'Subscribed'. This is also assigned to subscription purchasers, but never expires. Hence we can find users whose subscriptions have lapsed by looking for users with the role Subscribed but not Subscriber. [This is done using the View and Update Users screen - http://www.openvpms.org/admin/userlist ]

There is also the role Subscriber-Ex. This is used to flag ex-subscribers. No user should have the roles Subscribed and Subscriber-Ex at the same time. There is no programmed block against this, it is just illogical to do so.  Any user who used to be a subscriber, but no longer is (either because they are no longer an OpenVPMS user, if their practice's subscription is held under another name) should have their role Subscribed removed and Subscriber-Ex added. This is done manually by editing the user.

We have also created the following roles:

'FiftyPercenter':  This is manually assigned by the shop manager to any users who were early supporters of OpenVPMS and who are entitled to a 50% discount on their $300 subscription but pay the $150 development levy via the 'Early OpenVPMS Supporter' discount of 33.3333%. The store manager assigns the role via http://www.openvpms.org/users/xxxx (where xxxx is the user's login name) to access the user's profile and then editing this to set the role FiftyPercenter.

'Not For Profit (with clinic)': This is manually assigned to any organisation that is a) not for profit; b) runs a vet clinic open to all. This role gets the 'Not for profit clinic' discount of 33.3333%

'Not For Profit (no clinic)': This is manually assigned to any organisation that is a) not for profit; b) does not run a vet clinic open to outsiders. This role gets the 'Zero Cost' 100% discount.

'Developer': This is manually assigned to any person who is doing development amed at improving/expanding OpenVPMS. This role also gets the 'Zero Cost' 100% discount.

Note that via the role_delegation module, the store manager is explicitly given permission to set/unset the Subscriber, Subscribed, Subscriber-Ex and FiftyPercenter roles for any user.

If you do need to manually set the Subscriber role for some reason, do NOT just tick the Subscriber role, but rather, down the bottom of the page in the Ubercart roles section, add the Subscriber role with the appropriate expiry date.

 

Syndicate content