sdaigle2 / Abacus-mvp

20 stars 1 forks source link

Limit Discounts to 25% unless superAdmin #62

Closed sdaigle2 closed 8 years ago

sdaigle2 commented 8 years ago

Assigned to scott

sdaigle2 commented 8 years ago

On the admin page

if (userType <> superAdmin) and (discount >25) { //display a message that says "As an admin, you may only create discount codes no greater than 25%. Please contact Chris, Danny, or Cesar for approval to create a larger discount. //do not create the discount }

sdaigle2 commented 8 years ago

Fixed with: ed64b695fa4fc5fa09db5e4d4d5bf0f5906a0486. Good job @as-david-m

sdaigle2 commented 7 years ago

We noticed a new error with permissions for Super Admins

Steps to reproduce:

0.) Set your environment variables so that you are using the testing cloudant database. intelliwheels-testing and 9T4Ejs2fFHu6 Once that's done, start the server and go to localhost:8080 1.) Log in as a superAdmin. You can optionally use the username sdaigle2@gmail.com and the password wheelchair34 2.) Click on Admin in the the top menu 3.) Click on Discounts in the left menu 4.) Click on Create a new discount in the left menu 5.) Attempt to create a new discount for 30%. Notice that it gives you an error message. Since you are a SuperAdmin, you should not have received this error message, but you do.

Desired Behavior:

1) User type Admin can create discounts <=25%. If they try to create a discount >25% they should receive the error message. 2) User type SuperAdmin can create discounts of any amount. They should never see the error message unless something goes wrong while communicating with the database.

as-sergey-m commented 7 years ago

Added fix with https://github.com/IntelliWheelsInc/Abacus-mvp/pull/84