plate_id 0.0.0 → 0.0.5

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: d4151d00de7c7c38bc47ea35c0267bcba125771227fb74eee5f5fb9199e4ae28
4
- data.tar.gz: 9103e79ca0733b0a6352dcfdfd03a23a67c52d8a49ff1be79b677978eb76ec19
3
+ metadata.gz: 5049ac8ebc480808709a64331a1bfa81ca18439cd9be1ca90e1a3b7210df0585
4
+ data.tar.gz: f1b9fbee8fcb9d927a6c6ce20de3b4cfe2212c8bd87e9159cf041c7ec7d35a05
5
5
  SHA512:
6
- metadata.gz: 5b70fca72ad26435053e59a4c14c511053c6234bcbe4d6d037076ef9a32aaf7f0df599ceae47ce4edaea4dc71d718825a4492392bfa9fda706f747c4238c07e5
7
- data.tar.gz: a1d98817a18b6f6ca023e09d6e0592214b9ac7a9562fa1beaa91608f4ba413694a4cbdf6e6cfa6f192645b68866e302e5d1a5f8ba972b800cef370cfd00ba1f5
6
+ metadata.gz: 85c51e9581ecc77a27ee583570d8e3da2077714d3101663c5345f66ed4b3fc28f999fde3a4cf6b1251a75f213697225462b1d681690b3ce42d2688ba45cbcacd
7
+ data.tar.gz: 03d03dd24752f22546c785f1f3845a51378e6c2fd8d9cac10f2054b4ae60e376a051c04f206ba90be60142c83941555c16dfea64b56d36994d57a2eebba82680
data/lib/plate_id.rb CHANGED
@@ -33,6 +33,10 @@ class PlateID
33
33
  uri.id
34
34
  end
35
35
 
36
+ def id=(id)
37
+ uri.id = id
38
+ end
39
+
36
40
  def to_s
37
41
  uri.to_s
38
42
  end
data/lib/uri/plate_id.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'cgi'
2
+
1
3
  module URI
2
4
  class PlateID < Generic
3
5
 
@@ -7,6 +9,8 @@ module URI
7
9
  #
8
10
  # The URI format looks like "plateid://group_name/base_class/id".
9
11
 
12
+ attr_writer :id
13
+
10
14
  MAPPING = {
11
15
  "Site" => { host: "Base", base_class: "Site" },
12
16
  "Ngn::Attachment" => { host: "Base", base_class: "Attachment" },
@@ -20,6 +24,7 @@ module URI
20
24
  "Ngn::Content::Element" => { host: "Content", base_class: "Element" },
21
25
  "Ngn::Content::ContentObject" => { host: "Content", base_class: "ContentObject" },
22
26
  "Ngn::Content::SiteTranslation" => { host: "Content", base_class: "SiteTranslation" },
27
+ "Ngn::Content::AuthenticationObject" => { host: "Content", base_class: "AuthenticationObject" },
23
28
 
24
29
  "Ngn::ContentModel::ContentField" => { host: "ContentModel", base_class: "ContentField" },
25
30
  "Ngn::ContentModel::ContentFieldTab" => { host: "ContentModel", base_class: "ContentFieldGroup" },
@@ -34,14 +39,17 @@ module URI
34
39
  "Ngn::Theming::ThemeFile" => { host: "Theming", base_class: "ThemeFile" },
35
40
  "Ngn::Theming::Prerender" => { host: "Theming", base_class: "Prerender" },
36
41
 
37
- "Ngn::Auth::User" => { host: "Auth", base_class: "User" },
38
- "Ngn::Auth::ApiIntegration" => { host: "Auth", base_class: "ApiIntegration" },
39
-
40
- "Ngn::Auth::AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" },
42
+ "Org::Auth::User" => { host: "Auth", base_class: "User" },
43
+ "Api::Integration" => { host: "Auth", base_class: "ApiIntegration" },
41
44
 
42
45
  "Org::Company" => { host: "Organization", base_class: "Company" },
43
46
  "Org::Partner" => { host: "Organization", base_class: "Partner" },
44
- "Org::FormMessage" => { host: "Organization", base_class: "FormMessage" }
47
+ "Org::FormMessage" => { host: "Organization", base_class: "FormMessage" },
48
+
49
+ # Access control
50
+ "AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" },
51
+ "AccessControl::Role" => { host: "AccessControl", base_class: "Role" },
52
+ "AccessControl::Group" => { host: "AccessControl", base_class: "Group" }
45
53
  }
46
54
 
47
55
  attr_reader :base_class, :id
@@ -67,13 +75,13 @@ module URI
67
75
 
68
76
  # Create a new URI::PlateID from components with argument check.
69
77
  #
70
- # The allowed components are app, model_name, model_id and params, which
78
+ # The allowed components are model_name and model_id, which
71
79
  # can be either a hash or an array.
72
80
  #
73
81
  # Using a hash:
74
82
  #
75
83
  # URI::PlateID.build(
76
- # model_name: 'Ngn::ContentModelElementType',
84
+ # model_name: 'Ngn::ContentModel::ElementType',
77
85
  # model_id: '1'
78
86
  # )
79
87
  def build(args)
data/plate_id.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "plate_id"
5
- spec.version = "0.0.0"
5
+ spec.version = "0.0.5"
6
6
  spec.authors = ["Kobus Post"]
7
7
  spec.email = ["kobus@getplate.com"]
8
8
  spec.homepage = "https://www.getplate.com"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plate_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kobus Post
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Identify any Plate record or class with URIs. Somewhat based on Rails's
14
14
  GlobalID gem.