First version for App and Object auth.Taking Announcement as experiment
This commit is contained in:
1 parent
3bcd7ea349
commit
cc550c5745
28 files changed
+146
-34
No files matched your search
@@ -3,4 +3,9 @@ module Admin::AppAuthHelper
|
||||
link_to t(:enable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch'
|
||||
link_to t(:disable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch'
|
||||
end
|
||||
|
||||
def if_permitted_to(user,role)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -5,4 +5,17 @@ module AdminHelper
|
||||
link_to('/' , admin_items_path) + ( @parent_items.map{ |i| link_to(i.name, admin_items_path(:parent_id=>i.id) ) } << @parent_item.name ).join("/").html_safe
|
||||
end
|
||||
|
||||
# Check if the current_user is manager in current module app
|
||||
def is_manager?
|
||||
@module_app.is_manager?(current_user) || is_admin?
|
||||
end
|
||||
|
||||
# Check if the current_user is sub manager in current module app
|
||||
def is_sub_manager?
|
||||
@module_app.is_sub_manager?(current_user)|| is_admin?
|
||||
end
|
||||
|
||||
def is_admin?
|
||||
current_user.admin?
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user