Sha256: f7440b9c0a22263fc18fa595fa99be39f5c9f361b67a434653f3e7aa9b89f711
Contents?: true
Size: 631 Bytes
Versions: 11
Compression:
Stored size: 631 Bytes
Contents
# @author Lovell McIlwain # # Authorization for article objects class <%= options[:name].camelize %>Policy < ApplicationPolicy # Allow all users to access new article objects def new? true end # Allows owner of an article to edit the article def edit? user == record.user end # Allows all users to create article objects alias_method :create?, :new? # Allows all users to view article objects alias_method :show?, :new? # Allows owner of an article to update an article object alias_method :update?, :edit? # Allows owner of an object to remove an object alias_method :destroy?, :edit? end
Version data entries
11 entries across 11 versions & 1 rubygems