discourse_subscription_client 0.1.0.pre10 → 0.1.0.pre11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7be1c54ac40f2c0221c35038e20c1daa1fac8f39c0736d11a858f805a6220791
4
- data.tar.gz: d8a564f4d2c9bc8ef052a47719c42dcc36df45ba42d8848d32fd6a8d03b0c8cb
3
+ metadata.gz: 6182382e0517359b04736dd702fc121669e40775a138eaf6bab7493ae722591a
4
+ data.tar.gz: 4554111e5f4b3659cfbf5d1ac70bed551237435e32c5265acf8a8093ca7db5d4
5
5
  SHA512:
6
- metadata.gz: f401dbabaa835f14619e4aa3263cee2df00048ae43c8fabd9fdae16e5c99806b6caf09896d4470c32923be77fe0a6b73d0efcd97589394d601647e3614e18d6a
7
- data.tar.gz: 0f10faf5cd3ed514bee5ef10555846c3c66f278e3adc8360a04d4ce8e5f56a12122aa86ed763b8c1988ca4815b39432d06219a1f981f4b0919244d387c4091e5
6
+ metadata.gz: 2988268b14449153a71e2345489f8cc97861b1d6562d62901724ba0db2151465a58bc153bffad9d5a516e2218cfd761523a0d95d8ca90a3e0c24351c1f21365b
7
+ data.tar.gz: e7d340f95ce7995c7edb4444987daec675706e056898613a2b7526af5010d5a239249e764d4e7804a0e3c75ac1ae0f16386c03e9c691d72ce0ff0f96bfeb45d1
data/README.md CHANGED
@@ -5,7 +5,7 @@ This gem is only for use with Discourse plugins. It provides subscription client
5
5
  Add this line to your plugin's `plugin.rb` file
6
6
 
7
7
  ```ruby
8
- gem "discourse_subscription_client", "0.1.0.pre5", require_name: "discourse_subscription_client"
8
+ gem "discourse_subscription_client", "0.1.0.pre11", require_name: "discourse_subscription_client"
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DiscourseSubscriptionClient
4
+ class NoAccessController < ApplicationController
5
+ def index
6
+ head :ok
7
+ end
8
+ end
9
+ end
@@ -10,13 +10,9 @@ class SubscriptionClientSupplier < ActiveRecord::Base
10
10
  scope :authorized, -> { where("api_key IS NOT NULL") }
11
11
 
12
12
  def destroy_authorization
13
- if DiscourseSubscriptionClient::Authorization.revoke(self)
14
- update(api_key: nil, user_id: nil, authorized_at: nil)
15
- deactivate_all_subscriptions!
16
- true
17
- else
18
- false
19
- end
13
+ DiscourseSubscriptionClient::Authorization.revoke(self)
14
+ update(api_key: nil, user_id: nil, authorized_at: nil)
15
+ deactivate_all_subscriptions!
20
16
  end
21
17
 
22
18
  def authorized?
data/config/routes.rb CHANGED
@@ -17,4 +17,6 @@ DiscourseSubscriptionClient::Engine.routes.draw do
17
17
  put "notices/:notice_id/dismiss" => "notices#dismiss"
18
18
  put "notices/:notice_id/hide" => "notices#hide"
19
19
  put "notices/:notice_id/show" => "notices#show"
20
+
21
+ get "no-access" => "no_access#index"
20
22
  end
@@ -29,6 +29,7 @@ module DiscourseSubscriptionClient
29
29
  ../../app/models/subscription_client_resource
30
30
  ../../app/models/subscription_client_subscription
31
31
  ../../app/models/subscription_client_supplier
32
+ ../../app/controllers/discourse_subscription_client/no_access_controller
32
33
  ../../app/controllers/discourse_subscription_client/admin_controller
33
34
  ../../app/controllers/discourse_subscription_client/subscriptions_controller
34
35
  ../../app/controllers/discourse_subscription_client/suppliers_controller
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiscourseSubscriptionClient
4
- VERSION = "0.1.0.pre10"
4
+ VERSION = "0.1.0.pre11"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_subscription_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre10
4
+ version: 0.1.0.pre11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-24 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -233,6 +233,7 @@ files:
233
233
  - app/assets/config/discourse_subscription_client_manifest.js
234
234
  - app/assets/stylesheets/discourse_subscription_client/application.css
235
235
  - app/controllers/discourse_subscription_client/admin_controller.rb
236
+ - app/controllers/discourse_subscription_client/no_access_controller.rb
236
237
  - app/controllers/discourse_subscription_client/notices_controller.rb
237
238
  - app/controllers/discourse_subscription_client/subscriptions_controller.rb
238
239
  - app/controllers/discourse_subscription_client/suppliers_controller.rb