radiant-group_forum-extension 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.2
@@ -1,5 +1,5 @@
1
1
  class GroupForumExtension < Radiant::Extension
2
- version "0.5.0"
2
+ version "0.5.2"
3
3
  description "Just a bit of access-control glue joining reader_groups to forum"
4
4
  url "http://spanner.org/radiant/group_forums"
5
5
 
@@ -0,0 +1,27 @@
1
+ module GroupedControllerExtensions
2
+
3
+ def self.included(base)
4
+ base.class_eval {
5
+ before_filter :require_visibility_to_reader
6
+
7
+ protected
8
+
9
+ def require_visibility_to_reader
10
+ if @page && !@page.visible_to?(current_reader)
11
+ flash[:error] = t("page_not_public")
12
+ redirect_to reader_permission_denied_url
13
+ return false
14
+ end
15
+
16
+ if @forum && !@forum.visible_to?(current_reader)
17
+ flash[:error] = "forum_not_public"
18
+ redirect_to reader_permission_denied_url
19
+ return false
20
+ end
21
+ end
22
+ }
23
+ end
24
+ end
25
+
26
+
27
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-group_forum-extension}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "db/migrate/20091008101339_simple_ownership.rb",
27
27
  "group_forum_extension.rb",
28
28
  "lib/group_forum_tags.rb",
29
+ "lib/grouped_controller_extensions.rb",
29
30
  "lib/tasks/group_forum_extension_tasks.rake",
30
31
  "radiant-group_forum-extension.gemspec",
31
32
  "spec/datasets/group_forum_forums_dataset.rb",
@@ -5,8 +5,8 @@ class GroupForumForumsDataset < Dataset::Base
5
5
 
6
6
  def load
7
7
  create_forum "Public"
8
- create_forum "Grouped", :group => groups(:chatty)
9
- create_forum "Alsogrouped", :group => groups(:chatty)
8
+ create_forum "Grouped", :groups => [groups(:chatty)]
9
+ create_forum "Alsogrouped", :groups => [groups(:chatty)]
10
10
  end
11
11
 
12
12
  helpers do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-group_forum-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -81,6 +81,7 @@ files:
81
81
  - db/migrate/20091008101339_simple_ownership.rb
82
82
  - group_forum_extension.rb
83
83
  - lib/group_forum_tags.rb
84
+ - lib/grouped_controller_extensions.rb
84
85
  - lib/tasks/group_forum_extension_tasks.rake
85
86
  - radiant-group_forum-extension.gemspec
86
87
  - spec/datasets/group_forum_forums_dataset.rb