Sha256: 9f2c40b7c3bfe6acb331567f00f6bfea3703021a7d5b4438ebbafb033fe9010b
Contents?: true
Size: 920 Bytes
Versions: 17
Compression:
Stored size: 920 Bytes
Contents
class Iugu::SettingsController < ApplicationController before_filter :authenticate_user!, :except => :add_social before_filter :verify_token layout IuguSDK.default_layout def index redirect_to :profile_settings, :notice => flash[:notice] end def must_be (roles, param_name) access = false @account_user = AccountUser.find_by_user_id_and_account_id(current_user.id, params[param_name]) raise ActionController::RoutingError.new("Not Found") unless @account_user if roles.class == Array roles.each do |role| access = true if @account_user.is?(role) end else access = true if @account_user.is?(roles) end raise ActionController::RoutingError.new("Access Denied") if access == false end private def verify_token if IuguSDK::enable_user_api and current_user current_user.send(:init_token) unless current_user.token end end end
Version data entries
17 entries across 17 versions & 1 rubygems