Skip to content

Instantly share code, notes, and snippets.

@cmaujean
Created July 10, 2011 18:50
Show Gist options
  • Save cmaujean/1074840 to your computer and use it in GitHub Desktop.
Save cmaujean/1074840 to your computer and use it in GitHub Desktop.
# Content Manager
# – can access overview, reports, events, faq, snippets, and pages.
class ContentAbility
include CanCan::Ability
def initialize(user)
if user.has_role?(:content)
can :manage, :all
cannot :manage, Product
cannot :manage, Configuration
cannot :manage, Order
cannot :manage, Promotion
cannot :manage, User
can :read, User do |resource|
resource == user
end
can :update, User do |resource|
resource == user
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment