Sha256: b68506c12027c36125480a80d4456dc53992f465dad7c1cbe6930265af00bb9b
Contents?: true
Size: 766 Bytes
Versions: 1
Compression:
Stored size: 766 Bytes
Contents
module Saucy module AccountAuthorization extend ActiveSupport::Concern included do helper_method :current_account, :current_project include InstanceMethods end module InstanceMethods protected def current_account ::Account.find_by_url!(params[:account_id]) end def current_project ::Project.find(params[:project_id]) end def authorize_admin unless current_user.admin_of?(current_account) deny_access("You must be an admin to access that page.") end end def authorize_member unless current_user.member_of?(current_project) deny_access("You do not have permission for this project.") end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
saucy-0.1.9 | lib/saucy/account_authorization.rb |