Module: AeUsers
- Defined in:
- lib/ae_users.rb
Defined Under Namespace
Modules: Acts, ControllerExtensions, FormBuilderFunctions, FormHelperFunctions, HelperFunctions, InstanceTagExtensions
Classes: PermissionCache
Constant Summary
collapse
- @@signup_allowed =
true
- @@permissioned_classes =
[]
- @@js_framework =
"prototype"
- @@cache_permissions =
true
- @@permission_cache =
AeUsers::PermissionCache.new
Class Method Summary
collapse
Class Method Details
.add_permissioned_class(klass) ⇒ Object
23
24
25
26
27
|
# File 'lib/ae_users.rb', line 23
def self.add_permissioned_class(klass)
if not @@permissioned_classes.include?(klass.name)
@@permissioned_classes.push(klass.name)
end
end
|
.cache_permissions=(value) ⇒ Object
127
128
129
|
# File 'lib/ae_users.rb', line 127
def self.cache_permissions=(value)
@@cache_permissions = value
end
|
.cache_permissions? ⇒ Boolean
131
132
133
|
# File 'lib/ae_users.rb', line 131
def self.cache_permissions?
@@cache_permissions
end
|
.disallow_signup ⇒ Object
18
19
20
|
# File 'lib/ae_users.rb', line 18
def self.disallow_signup
@@signup_allowed = false
end
|
.js_framework ⇒ Object
42
43
44
|
# File 'lib/ae_users.rb', line 42
def self.js_framework
@@js_framework
end
|
.js_framework=(framework) ⇒ Object
46
47
48
|
# File 'lib/ae_users.rb', line 46
def self.js_framework=(framework)
@@js_framework = framework
end
|
.map_openid(map) ⇒ Object
65
66
67
|
# File 'lib/ae_users.rb', line 65
def self.map_openid(map)
map.open_id_complete 'auth', :controller => "auth", :action => "login", :requirements => { :method => :get }
end
|
.permission_cache ⇒ Object
135
136
137
|
# File 'lib/ae_users.rb', line 135
def self.permission_cache
@@permission_cache
end
|
.permissioned_class(name) ⇒ Object
35
36
37
38
39
|
# File 'lib/ae_users.rb', line 35
def self.permissioned_class(name)
if @@permissioned_classes.include?(name)
return eval(name)
end
end
|
.permissioned_classes ⇒ Object
29
30
31
32
33
|
# File 'lib/ae_users.rb', line 29
def self.permissioned_classes
return @@permissioned_classes.collect do |name|
eval(name)
end
end
|
.profile_class ⇒ Object
yeah, the following 2 functions are Incredibly Evil(tm). I couldn’t find any other way to pass around an ActiveRecord class without having it be potentially overwritten on association access.
53
54
55
|
# File 'lib/ae_users.rb', line 53
def self.profile_class
nil
end
|
.profile_class=(klass) ⇒ Object
57
58
59
60
61
62
63
|
# File 'lib/ae_users.rb', line 57
def self.profile_class=(klass)
module_eval <<-END_FUNC
def self.profile_class
return #{klass.name}
end
END_FUNC
end
|
.signup_allowed? ⇒ Boolean
14
15
16
|
# File 'lib/ae_users.rb', line 14
def self.signup_allowed?
@@signup_allowed
end
|