Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions admin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
require 'pry'

#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
def user_permission (signed_in, admin, paid, cancelled)
if (paid=="no") or (cancelled=="yes")
puts "go away!"
elsif (signed_in=="yes") and (admin=="yes")
puts "you can see and change all the pages!"
elsif (signed_in=="yes") and (admin=="no")
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 "have you paid your bills? answer yes or no"
user_paid = gets.strip

puts "have you cancelled a deal? answer yes or no"
user_deal = gets.strip

puts "are you an admin? answer yes or no"
user_admin = gets.strip

puts "are you signed in? answer yes or no"
user_signed = gets.strip

user_permission(user_signed, user_admin, user_paid, user_deal)

#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

#######################################################
Expand All @@ -28,4 +54,4 @@

#store their answer in a variable

#call the function
#call the function