lockdown 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.5.4 2008-06-05
2
+ * Fixed: Issue with helpers in Rails 2.1, @action_name is no longer accessible, must call action_name method.
3
+ * Fixed: Issue with users controller, show method not having user_groups_for_user instance variable
4
+ * Modified: The end of the lockdown executable now references stonean.com instead of rubyforge site.
5
+
1
6
  == 0.5.3 2008-06-01
2
7
  * Fixed: Issue with new timestamped based migrations in rails 2.1. Migration templates created were all done within the same second, therefore having the same timestamp, added a sleep call to the next_migration_string to get around the issue.
3
8
 
data/bin/lockdown CHANGED
@@ -117,20 +117,16 @@ MSG
117
117
 
118
118
  puts <<-MSG
119
119
  \n------------------------------------------------------------
120
- You are now locked down. To open up access to your application
121
- please modify lib/lockdown/init.rb. This is where you'll
122
- add permissions and create user groups.
120
+ You are now locked down. To open up access to your
121
+ application please modify lib/lockdown/init.rb. This is
122
+ where you'll add permissions and create user groups.
123
123
 
124
124
  To modify the contents of your session and to add access
125
125
  methods, modify lib/lockdown/session.rb.
126
126
 
127
- If you want to know more, please visit:
127
+ For the wiki, news, forum and issue tracker please visit:
128
128
 
129
- http://lockdown.rubyforge.org
129
+ http://stonean.com/projects/show/lockdown
130
130
 
131
- If you have any suggestions, comments or issues
132
- please visit the Lockdown Google group:
133
-
134
- http://groups.google.com/group/stonean_lockdown?hl=en
135
131
  ------------------------------------------------------------\n
136
132
  MSG
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -10,6 +10,16 @@ end
10
10
 
11
11
  class LockdownGenerator < Rails::Generator::Base
12
12
  attr_accessor :file_name
13
+ attr_accessor :action_name
14
+
15
+ def initialize(runtime_args, runtime_options = {})
16
+ super
17
+ if Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 1
18
+ @action_name = "action_name"
19
+ else
20
+ @action_name = "@action_name"
21
+ end
22
+ end
13
23
 
14
24
  def manifest
15
25
  record do |m|
@@ -47,13 +57,13 @@ class LockdownGenerator < Rails::Generator::Base
47
57
  m.file "app/controllers/user_groups_controller.rb",
48
58
  "app/controllers/user_groups_controller.rb"
49
59
 
50
- m.file "app/helpers/permissions_helper.rb",
60
+ m.template "app/helpers/permissions_helper.rb",
51
61
  "app/helpers/permissions_helper.rb"
52
62
 
53
- m.file "app/helpers/users_helper.rb",
63
+ m.template "app/helpers/users_helper.rb",
54
64
  "app/helpers/users_helper.rb"
55
65
 
56
- m.file "app/helpers/user_groups_helper.rb",
66
+ m.template "app/helpers/user_groups_helper.rb",
57
67
  "app/helpers/user_groups_helper.rb"
58
68
 
59
69
  copy_views(m, "users")
@@ -14,6 +14,7 @@ class UsersController < ApplicationController
14
14
  # GET /users/1
15
15
  # GET /users/1.xml
16
16
  def show
17
+ @user_groups_for_user = Lockdown::System.user_groups_assignable_for_user(current_user)
17
18
  respond_to do |format|
18
19
  format.html # show.html.erb
19
20
  format.xml { render :xml => @user }
@@ -1,13 +1,13 @@
1
1
  module PermissionsHelper
2
2
  def permission_name_value
3
- h @permission.name
3
+ h @permission.name
4
4
  end
5
5
 
6
6
  def permission_access_rights_value
7
7
  Lockdown::System.access_rights_for_permission(@permission).collect{|r| r}.join("<br/>")
8
8
  end
9
9
 
10
- def permission_users_value
11
- @permission.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>")
10
+ def permission_users_value
11
+ @permission.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>")
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
1
  module UserGroupsHelper
2
2
  def user_group_name_value
3
- if @action_name == "show"
3
+ if <%= action_name %> == "show"
4
4
  h @user_group.name
5
5
  else
6
6
  text_field_tag "user_group[name]", @user_group.name
@@ -8,28 +8,28 @@ module UserGroupsHelper
8
8
  end
9
9
 
10
10
  def user_group_permissions_value
11
- if @action_name == "show"
11
+ if <%= action_name %> == "show"
12
12
  @user_group.permissions.collect{|p| p.name + "<br/>"}
13
13
  else
14
- rvalue = %{<ul id="all_permissions" class="checklist">}
15
- @all_permissions.each_with_index do |perm,i|
16
- bg = ( i % 2 == 0 ) ? "even" : "odd"
17
- input_id = "perm_#{perm.id}"
18
- checked = (@user_group.permission_ids.include?(perm.id) ? "checked" : "")
19
- bg << "_" << checked if checked.length > 0
20
- rvalue << <<-HTML
21
- <li class="#{bg}">
22
- <label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')">
23
- <input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/>&nbsp;&nbsp;#{perm.name}
24
- </label>
25
- </li>
26
- HTML
14
+ rvalue = %{<ul id="all_permissions" class="checklist">}
15
+ @all_permissions.each_with_index do |perm,i|
16
+ bg = ( i % 2 == 0 ) ? "even" : "odd"
17
+ input_id = "perm_#{perm.id}"
18
+ checked = (@user_group.permission_ids.include?(perm.id) ? "checked" : "")
19
+ bg << "_" << checked if checked.length > 0
20
+ rvalue << <<-HTML
21
+ <li class="#{bg}">
22
+ <label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')">
23
+ <input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/>&nbsp;&nbsp;#{perm.name}
24
+ </label>
25
+ </li>
26
+ HTML
27
27
  end
28
- rvalue << "</ul>"
28
+ rvalue << "</ul>"
29
29
  end
30
30
  end
31
31
 
32
- def user_group_users_value
33
- @user_group.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>")
32
+ def user_group_users_value
33
+ @user_group.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>")
34
34
  end
35
35
  end
@@ -1,6 +1,6 @@
1
1
  module UsersHelper
2
2
  def profile_first_name_value
3
- if @action_name == "show"
3
+ if <%= action_name %> == "show"
4
4
  h @profile.first_name
5
5
  else
6
6
  text_field_tag "profile[first_name]", @profile.first_name
@@ -8,7 +8,7 @@ module UsersHelper
8
8
  end
9
9
 
10
10
  def profile_last_name_value
11
- if @action_name == "show"
11
+ if <%= action_name %> == "show"
12
12
  h @profile.last_name
13
13
  else
14
14
  text_field_tag "profile[last_name]", @profile.last_name
@@ -16,7 +16,7 @@ module UsersHelper
16
16
  end
17
17
 
18
18
  def profile_email_value
19
- if @action_name == "show"
19
+ if <%= action_name %> == "show"
20
20
  h @profile.email
21
21
  else
22
22
  text_field_tag "profile[email]", @profile.email
@@ -24,7 +24,7 @@ module UsersHelper
24
24
  end
25
25
 
26
26
  def user_login_value
27
- if @action_name == "show"
27
+ if <%= action_name %> == "show"
28
28
  h @user.login
29
29
  else
30
30
  text_field_tag "user[login]", @user.login
@@ -32,7 +32,7 @@ module UsersHelper
32
32
  end
33
33
 
34
34
  def user_password_value
35
- if @action_name == "show"
35
+ if <%= action_name %> == "show"
36
36
  h "Hidden for security..."
37
37
  else
38
38
  %{<input autocomplete="off" type="password" name="user[password]" id="user_password"/>}
@@ -40,7 +40,7 @@ module UsersHelper
40
40
  end
41
41
 
42
42
  def user_password_confirmation_value
43
- if @action_name == "show"
43
+ if <%= action_name %> == "show"
44
44
  h "Hidden for security..."
45
45
  else
46
46
  %{<input autocomplete="off" type="password" name="user[password_confirmation]" id="user_password_confirmation"/>}
@@ -48,7 +48,7 @@ module UsersHelper
48
48
  end
49
49
 
50
50
  def user_user_groups_value
51
- if @action_name == "show"
51
+ if <%= action_name %> == "show"
52
52
  @user.user_groups.collect{|ug| ug.name + "<br/>"}
53
53
  else
54
54
  rvalue = %{<ul id="all_user_groups" class="checklist">}
@@ -33,7 +33,7 @@
33
33
  <h1>Lockdown</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lockdown"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.3</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.4</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Lockdown</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lockdown"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.3</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.4</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
@@ -41,6 +41,16 @@
41
41
  <p>Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). While Merb functionality is in place, it is not complete. There will be a release solely focused on getting the Merb functionality up to par with Rails.</p>
42
42
 
43
43
 
44
+ <h2>Consolidation of information</h2>
45
+
46
+
47
+ <p>Maintaining this page, the wiki at GitHub, the Google Group and no issue tracker is not an ideal setup. So, everything is moving to <a href="http://stonean.com">stonean.com</a> where I&#8217;m giving <a href="http://redmine.org">Redmine</a> a shot a running everything for me. I&#8217;ll be posting release announcements to the news feed for each project and keeping the docs up-to-date. Hopefully this will be better for everyone.</p>
48
+
49
+
50
+ <p>Thanks for your interest in Lockdown,<br/>
51
+ -andy</p>
52
+
53
+
44
54
  <h2>Installing</h2>
45
55
 
46
56
 
@@ -314,7 +324,7 @@ When referring to access rights: if you have a standard <span class="caps">REST<
314
324
 
315
325
  <p><a href="http://blog.stonean.com">Andrew Stone</a></p>
316
326
  <p class="coda">
317
- 22nd May 2008<br/>
327
+ 2nd June 2008<br/>
318
328
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
319
329
  </p>
320
330
  </div>
data/website/index.txt CHANGED
@@ -4,6 +4,13 @@ h2. What
4
4
 
5
5
  Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). While Merb functionality is in place, it is not complete. There will be a release solely focused on getting the Merb functionality up to par with Rails.
6
6
 
7
+ h2. Consolidation of information
8
+
9
+ Maintaining this page, the wiki at GitHub, the Google Group and no issue tracker is not an ideal setup. So, everything is moving to "stonean.com":http://stonean.com where I'm giving "Redmine":http://redmine.org a shot a running everything for me. I'll be posting release announcements to the news feed for each project and keeping the docs up-to-date. Hopefully this will be better for everyone.
10
+
11
+ Thanks for your interest in Lockdown,<br/>
12
+ -andy
13
+
7
14
  h2. Installing
8
15
 
9
16
  <pre>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-01 00:00:00 -04:00
12
+ date: 2008-06-05 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency