tonkapark-clearance 0.6.9.2 → 0.6.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.textile +5 -0
- data/README.textile +1 -1
- data/Rakefile +1 -1
- data/TODO.textile +3 -4
- data/app/controllers/clearance/invitations_controller.rb +12 -0
- data/app/views/invitations/index.html.erb +0 -1
- data/clearance.gemspec +1 -1
- data/config/clearance_routes.rb +1 -1
- data/generators/clearance/templates/migrations/create_users.rb +1 -0
- data/generators/clearance/templates/migrations/update_users.rb +1 -0
- metadata +1 -1
data/CHANGELOG.textile
CHANGED
data/README.textile
CHANGED
data/Rakefile
CHANGED
@@ -53,7 +53,7 @@ task :default => ['test:all', 'test:features']
|
|
53
53
|
|
54
54
|
gem_spec = Gem::Specification.new do |gem_spec|
|
55
55
|
gem_spec.name = "clearance"
|
56
|
-
gem_spec.version = "0.6.9.
|
56
|
+
gem_spec.version = "0.6.9.3"
|
57
57
|
gem_spec.summary = "Rails authentication with email & password and invitations."
|
58
58
|
gem_spec.email = "matt@tonkapark.com"
|
59
59
|
gem_spec.homepage = "http://github.com/tonkapark/clearance"
|
data/TODO.textile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
h1. To-do
|
2
1
|
|
3
|
-
|
4
|
-
* Change generated README to include instruction about running the migration.
|
5
|
-
* DO_NOT_REPLY, HOST refactoring.
|
2
|
+
h1. Tonka Park FORK TODO
|
6
3
|
|
4
|
+
* Allow users to invite users
|
5
|
+
* Resend invitation
|
@@ -2,6 +2,12 @@ class Clearance::InvitationsController < ApplicationController
|
|
2
2
|
unloadable
|
3
3
|
|
4
4
|
before_filter :redirect_to_root, :only => [:new, :create], :if => :signed_in?
|
5
|
+
before_filter :admin_only, :only => [:index]
|
6
|
+
|
7
|
+
def index
|
8
|
+
@invitations = ::Invitation.all
|
9
|
+
render :template => 'invitations/index'
|
10
|
+
end
|
5
11
|
|
6
12
|
def new
|
7
13
|
@invitation = ::Invitation.new(params[:invitation])
|
@@ -25,4 +31,10 @@ class Clearance::InvitationsController < ApplicationController
|
|
25
31
|
end
|
26
32
|
end
|
27
33
|
|
34
|
+
private
|
35
|
+
def admin_only
|
36
|
+
unless current_user.admin?
|
37
|
+
redirect_to root_url
|
38
|
+
end
|
39
|
+
end
|
28
40
|
end
|
data/clearance.gemspec
CHANGED
data/config/clearance_routes.rb
CHANGED
@@ -19,7 +19,7 @@ ActionController::Routing::Routes.draw do |map|
|
|
19
19
|
|
20
20
|
map.resources :invitations,
|
21
21
|
:controller => 'clearance/invitations',
|
22
|
-
:only => [:new, :create]
|
22
|
+
:only => [:index, :new, :create]
|
23
23
|
|
24
24
|
map.recover_password '/recover_password', :controller =>'clearance/passwords', :action => 'new'
|
25
25
|
|
@@ -7,6 +7,7 @@ class ClearanceCreateUsers < ActiveRecord::Migration
|
|
7
7
|
t.string :token, :limit => 128
|
8
8
|
t.datetime :token_expires_at
|
9
9
|
t.boolean :email_confirmed, :default => false, :null => false
|
10
|
+
t.boolean :admin, :default => false, :null => false
|
10
11
|
t.integer :invitation_id
|
11
12
|
t.integer :invitation_limit
|
12
13
|
t.timestamps
|
@@ -9,6 +9,7 @@ class ClearanceUpdateUsers < ActiveRecord::Migration
|
|
9
9
|
[:token, 't.string :token, :limit => 128'],
|
10
10
|
[:token_expires_at, 't.datetime :token_expires_at'],
|
11
11
|
[:email_confirmed, 't.boolean :email_confirmed, :default => false, :null => false'],
|
12
|
+
[:admin, 't.boolean :admin, :default => false, :null => false'],
|
12
13
|
[:invitation_id, 't.integer :invitation_id'],
|
13
14
|
[:invitation_limit, 't.integer :invitation_limit']
|
14
15
|
].delete_if {|c| existing_columns.include?(c.first.to_s)}
|