From 7dc8fbee20e93a9494a523e5bfd66bf8504d95cf Mon Sep 17 00:00:00 2001 From: Lauren Allanson Date: Sun, 14 Feb 2016 13:42:36 -0500 Subject: [PATCH] admin project --- admin.rb | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/admin.rb b/admin.rb index c751799..4747ae0 100644 --- a/admin.rb +++ b/admin.rb @@ -12,20 +12,60 @@ #if you user is signed in but they are not an admin, show "you can see all the pages!" #if the user is not signed in, show "you can't see any of the pages, please sign in!" +def user_permission + #ask the user if they pay their bills (yes/no) +puts("Are your bills paid?") + #store their answer in a variable +user_bills_status = gets.strip + #ask the user if they have canceled a deal (yes/no) +puts("Have you canceled a deal?") + #store their answer in a variable +user_deal_status = gets.strip + #ask the user if they are an admin (yes/no) +puts("Are you an admin?") + #store their answer in a variable +user_admin_status = gets.strip + #ask the user if they are signed in (yes/no) +puts("Are you signed in?") + #store their answer in a variable +user_signin_status = gets.strip + #call the function + + if user_bills_status == "no" or user_deal_status == "yes" + + puts("Go away, please.") + + elsif user_signin_status == "yes" and user_admin_status == "yes" + + puts("You can see and do everything.") + + elsif user_signin_status == "yes" and user_admin_status == "no" + + puts("You can see everything.") + + elsif user_signin_status == "no" + + puts("Please sign in.") + + end + +end + +user_permission