homeland-site 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 100a91cbb778fa30cadc54157f58511a8d20b84c
4
- data.tar.gz: 07a77e480da5f4fd2e01e4508f37946fdedf135b
3
+ metadata.gz: f634a2478ab4f74e3cd8f714b655f6e874d38ad4
4
+ data.tar.gz: 871f12d577ea34fe6c5c046539926ff61d5b2b30
5
5
  SHA512:
6
- metadata.gz: f9989b5528f168c9cd58452f4df42e828490fd4c9b82a0f71950f635406f587c7ecc8fadd2c97ed213303286e2d510e93dbc97faa5d1b8b4a21df0afe95e1e83
7
- data.tar.gz: a4ba5e639645678e2f30237b044763c05838fb80533a1273004a1f44a8ba9d7372c7a432114cafd2d652f0e139b8623d3f1214380add60d5c2576980219253b2
6
+ metadata.gz: 884db76e610ba4dc1f8e7b6ded7e536c712aae67c46e396ba5ffa26921714f95f7396faa2814189a016dd6a6695e02c2d9755da4213ead2e1d899c70f0aaa632
7
+ data.tar.gz: de81699890c82ba5a0af042b1d06659a766d51fa7abe9117d61bb8f7c00ed4f3835da4404470849b4e1cad30e231d1a293926d78bd4bcb73665b98a9c4b07bc7
@@ -5,10 +5,12 @@ module Homeland::Site
5
5
  end
6
6
 
7
7
  def new
8
+ authorize! :create, ::Site
8
9
  @site = ::Site.new
9
10
  end
10
11
 
11
12
  def create
13
+ authorize! :create, ::Site
12
14
  @site = ::Site.new(site_params)
13
15
  @site.user_id = current_user.id
14
16
  if @site.save
@@ -9,7 +9,7 @@ module Homeland::Site
9
9
  if @user.blank?
10
10
  roles_for_anonymous
11
11
  elsif user.roles?(:site_editor)
12
- can :create, Site
12
+ can :create, ::Site
13
13
  else
14
14
  roles_for_anonymous
15
15
  end
@@ -19,18 +19,18 @@ module Homeland::Site
19
19
 
20
20
  # 普通会员权限
21
21
  def roles_for_site_editors
22
- can :create, Site
22
+ can :create, ::Site
23
23
  basic_read_only
24
24
  end
25
25
 
26
26
  # 未登录用户权限
27
27
  def roles_for_anonymous
28
- cannot :manage, Site
28
+ cannot :manage, ::Site
29
29
  basic_read_only
30
30
  end
31
31
 
32
32
  def basic_read_only
33
- can :read, Site
33
+ can :read, ::Site
34
34
  end
35
35
  end
36
36
  end
@@ -1,7 +1,7 @@
1
1
  <% title_tag t('plugin.site') %>
2
2
 
3
3
  <div id="site_nodes">
4
- <% if can? :create, Site %>
4
+ <% if can? :create, ::Site %>
5
5
  <div class="panel panel-default">
6
6
  <div class="panel-body">
7
7
  <%= raw Setting.site_index_html %>
@@ -1,6 +1,6 @@
1
1
  module Homeland
2
2
  module Site
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  NAME = 'site'
5
5
  DESCRIPTION = 'Site for Homeland.'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeland-site
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee