mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-04 21:01:27 -05:00
fc095acaaa
- Supports throttled read and write - No support for push yet, but data is captured about intent
30 lines
839 B
Ruby
30 lines
839 B
Ruby
class UserApiKey < ActiveRecord::Base
|
|
belongs_to :user
|
|
|
|
def access
|
|
"#{read ? "r" : ""}#{write ? "w" : ""}#{push ? "p" : ""}"
|
|
end
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: user_api_keys
|
|
#
|
|
# id :integer not null, primary key
|
|
# user_id :integer not null
|
|
# client_id :string not null
|
|
# key :string not null
|
|
# application_name :string not null
|
|
# read :boolean not null
|
|
# write :boolean not null
|
|
# push :boolean not null
|
|
# push_url :string
|
|
# created_at :datetime
|
|
# updated_at :datetime
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_user_api_keys_on_client_id (client_id)
|
|
# index_user_api_keys_on_key (key) UNIQUE
|
|
# index_user_api_keys_on_user_id (user_id)
|
|
#
|