Sha256: 2bf7d9ab35578a9ffeeccfd2b28d052b25ad0aafdcb5e176bfd1957abf242ac3
Contents?: true
Size: 1.22 KB
Versions: 22
Compression:
Stored size: 1.22 KB
Contents
require 'killbill_client' module Kaui class User < ActiveRecord::Base devise :killbill_authenticatable # Managed by Devise attr_accessor :password attr_accessible :kb_tenant_id, :kb_username, :kb_session_id, :password # Called by Devise to perform authentication # Throws KillBillClient::API::Unauthorized on failure def self.find_permissions(kb_username, kb_password, api_key=KillBillClient.api_key, api_secret=KillBillClient.api_secret) do_find_permissions :username => kb_username, :password => kb_password, :api_key => api_key, :api_secret => api_secret end # Called by CanCan to perform authorization # Throws KillBillClient::API::Unauthorized on failure def permissions(api_key=KillBillClient.api_key, api_secret=KillBillClient.api_secret) User.do_find_permissions :session_id => kb_session_id, :api_key => api_key, :api_secret => api_secret end private def self.do_find_permissions(options = {}) KillBillClient.url = Kaui.killbill_finder.call KillBillClient::Model::Security.find_permissions options end end end
Version data entries
22 entries across 22 versions & 1 rubygems