From 3f155c64dce072faba98be38ecc6cc8c44c7aa3f Mon Sep 17 00:00:00 2001 From: Esmeralda Hoscoy Date: Sun, 13 Mar 2016 16:04:09 -0400 Subject: [PATCH] dannas edits --- admin.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/admin.rb b/admin.rb index 06551b9..8f1ccd5 100644 --- a/admin.rb +++ b/admin.rb @@ -1,5 +1,31 @@ require 'pry' +def user_permission(signed_in, admin, paid, cancelled) + if signed_in == "yes" and admin == "yes" and paid == "yes" and cancelled == "no" + puts "you can see and change all the pages!" + elsif paid == "no" or cancelled == "yes" + puts "Go away!" + elsif signed_in == "yes" + puts "You can see all the pages!" + elsif signed_in == "no" + puts "You can't see any of the pages, please sign in!" + end +end + +puts "Did you pay your bills? (yes/no)" +paid = gets.downcase.strip + +puts "Have you cancelled a deal? (yes/no)" +cancelled = gets.downcase.strip + +puts "Are you an admin? (yes/no)" +admin = gets.downcase.strip + +puts "Are you signed in? (yes/no)" +signed_in = gets.downcase.strip + +user_permission(signed_in, admin, paid, cancelled) + #you run a site that offers a matching service between vendors selling laptops and customers #..looking to purchase; you charge a fee to be listed as a vendor #your site's users must sign in and if they are an admin they are able to make changes to the site