Skip to content

Instantly share code, notes, and snippets.

View lesce's full-sized avatar

Andrei Bogdan Lescenco lesce

View GitHub Profile
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new
if user.is_god?
can :manage, :all
elsif user.is_king?
can :manage , User
{"utf8"=>"✓",
"authenticity_token"=>"UF/7q+PioI4CZBat9EzFGgEUaStPYZhr+cXClc1KAKU=",
"id"=>"1",
"courses"=>{"id"=>"1"},
"grade"=>"",
"date"=>{"year"=>"2012",
"month"=>"2",
"day"=>"13"},
"commit"=>"Adauga"}