caboose-cms 0.9.119 → 0.9.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/caboose/permission.rb +5 -4
- data/app/models/caboose/schema.rb +2 -1
- data/app/views/caboose/roles/edit.html.erb +2 -1
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb5683a980021f404392a2f015b989295670fa6e
|
|
4
|
+
data.tar.gz: 346da7005b08035b52ec6e16e3a399d30513d38b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fabbf562e74acb49526d3d1e2e1244b588e37978c8a55c0236ef6baf6538b8fce103fe1d537fe37309435e2c40de874e9f81ff5949fa5a9c1ec8f945540b2b85
|
|
7
|
+
data.tar.gz: 5daf70440e4f8dd445b0035b420112ea65fcea692d64cb4d4a8d4e19f3aca566a0e0338ba78edb78c99297863e18ea10672a19aaefa7a952c517c323e8c000f3
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
class Caboose::Permission < ActiveRecord::Base
|
|
3
3
|
self.table_name = "permissions"
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
belongs_to :site
|
|
5
6
|
has_many :role_permissions
|
|
6
|
-
has_many :roles, :through => :role_permissions
|
|
7
|
-
attr_accessible :action, :resource
|
|
7
|
+
has_many :roles, :through => :role_permissions
|
|
8
|
+
attr_accessible :action, :resource, :site_id
|
|
8
9
|
|
|
9
10
|
def self.allow(role_id, resource, action)
|
|
10
11
|
role = Role.find(role_id)
|
|
@@ -13,4 +14,4 @@ class Caboose::Permission < ActiveRecord::Base
|
|
|
13
14
|
role.permissions.push(perm)
|
|
14
15
|
role.save
|
|
15
16
|
end
|
|
16
|
-
end
|
|
17
|
+
end
|
|
@@ -558,7 +558,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
|
558
558
|
],
|
|
559
559
|
Caboose::Permission => [
|
|
560
560
|
[ :resource , :string ],
|
|
561
|
-
[ :action , :string ]
|
|
561
|
+
[ :action , :string ],
|
|
562
|
+
[ :site_id , :integer ]
|
|
562
563
|
],
|
|
563
564
|
Caboose::Post => [
|
|
564
565
|
[ :site_id , :integer ],
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
<h3>Permissions</h3>
|
|
29
29
|
<div id='permissions'>
|
|
30
30
|
<table class='data'>
|
|
31
|
-
<%
|
|
31
|
+
<% where = @site.is_master ? "(id is not null)" : "(site_id is null OR site_id = #{@site.id})" %>
|
|
32
|
+
<% Caboose::Permission.where(where).reorder("resource, action").all.each do |p| %>
|
|
32
33
|
<% has_permission = Caboose::RolePermission.where(:role_id => @role.id, :permission_id => p.id).exists? %>
|
|
33
34
|
<tr>
|
|
34
35
|
<td><input type='checkbox' name='perm<%= p.id %>' <%= raw has_permission ? "checked='true'" : '' %> onclick="toggle_permission(<%= p.id %>, <%= @role.id %>, $(this).prop('checked'));" /></td>
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: caboose-cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.120
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- William Barry
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pg
|