shibboleth_auth 0.1.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.1
@@ -12,6 +12,13 @@ module ShibbolethAuth
12
12
  end
13
13
  end
14
14
 
15
+ def is_admin?
16
+ #return true if ["cucumber", "test"].include? Rails.env
17
+ return true if ShibbolethAuth::AdminUsers.include?(username)
18
+ return true unless (ShibbolethAuth::AdminGroups & groups).empty?
19
+ false
20
+ end
21
+
15
22
  def initialize(env)
16
23
  # Development Settings
17
24
  if env["HTTP_HOST"] && ["localhost", "127.0.0.1"].any? {|url| env["HTTP_HOST"].include? url }
@@ -1,7 +1,7 @@
1
1
  = semantic_form_for 'shibboleth_debug_login', :url => shibboleth_debug_login_url do |f|
2
2
  = f.inputs "Shibboleth Debug Login" do
3
- = f.input :person_uid, :input_html => {:value => ShibbolethAuth::DebugDefaultUsername}
4
- = f.input :person_common_name, :input_html => {:value => ShibbolethAuth::DebugDefaultCommonName}
5
- = f.input :groups, :input_html => {:value => ShibbolethAuth::DebugDefaultGroups}
6
- = f.input :unscoped_affiliation, :input_html => {:value => ShibbolethAuth::DebugDefaultAffiliation}
3
+ = f.input :person_uid, :input_html => {:value => ShibbolethAuth::DebugDefaultUsername}, :label => t("shibboleth.person_uid")
4
+ = f.input :person_common_name, :input_html => {:value => ShibbolethAuth::DebugDefaultCommonName}, :label => t("shibboleth.person_common_name")
5
+ = f.input :groups, :input_html => {:value => ShibbolethAuth::DebugDefaultGroups}, :label => t("shibboleth.groups")
6
+ = f.input :unscoped_affiliation, :input_html => {:value => ShibbolethAuth::DebugDefaultAffiliation}, :label => t("shibboleth.unscoped_affiliation")
7
7
  = f.buttons
@@ -19,4 +19,8 @@ ShibbolethAuth::DevelopmentCommonName = 'Development User'
19
19
  # As Array
20
20
  ShibbolethAuth::DevelopmentGroups = ["my:prefix:group:..."]
21
21
  # As Array
22
- ShibbolethAuth::DevelopmentAffiliation = []
22
+ ShibbolethAuth::DevelopmentAffiliation = []
23
+
24
+ # Admin Users/Group
25
+ ShibbolethAuth::AdminUsers = %w(ab123456)
26
+ ShibbolethAuth::AdminGroups = %w(my:prefix:group:admins)
@@ -0,0 +1,6 @@
1
+ de:
2
+ shibboleth:
3
+ person_uid: Person UID
4
+ person_common_name: Name
5
+ groups: Gruppe
6
+ unscoped_affiliation: Affiliation
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{shibboleth_auth}
8
- s.version = "0.1.2"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dominik Masur"]
12
- s.date = %q{2010-09-09}
12
+ s.date = %q{2010-10-21}
13
13
  s.description = %q{Adds a Userobject and a debug Login/Logout to your Railsapplication}
14
14
  s.email = %q{masur@rz.rwth-aachen.de}
15
15
  s.extra_rdoc_files = [
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/generators/templates/app/views/shibboleth_auth/login/login_form.html.haml",
33
33
  "lib/generators/templates/app/views/shibboleth_auth/login/show.html.haml",
34
34
  "lib/generators/templates/config/initializers/shibboleth_auth.rb",
35
+ "lib/generators/templates/config/locales/de.yml",
35
36
  "lib/routes.rb",
36
37
  "lib/shibboleth_auth.rb",
37
38
  "shibboleth_auth.gemspec",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shibboleth_auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
8
  - 2
10
- version: 0.1.2
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dominik Masur
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-09 00:00:00 +02:00
18
+ date: 2010-10-21 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -107,6 +107,7 @@ files:
107
107
  - lib/generators/templates/app/views/shibboleth_auth/login/login_form.html.haml
108
108
  - lib/generators/templates/app/views/shibboleth_auth/login/show.html.haml
109
109
  - lib/generators/templates/config/initializers/shibboleth_auth.rb
110
+ - lib/generators/templates/config/locales/de.yml
110
111
  - lib/routes.rb
111
112
  - lib/shibboleth_auth.rb
112
113
  - shibboleth_auth.gemspec