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
26 changes: 26 additions & 0 deletions admin.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down