Object Auth. Now object can be included with "include OrbitCoreLib::ObjectAuthable" to use kernel method,such as
1.Object.authed_for_user(user,title_of_object_auth). title_of_object_auth is optional 2.object.authed_users(user,title_of_object_auth) . title_of_object_auth is optional if title_of_object_auth is not given,then it will return calculation across all possiblity.
This commit is contained in:
1 parent
3ed9b81df9
commit
e20739e32b
7 files changed
+96
-52
No files matched your search
@@ -1,8 +1,6 @@
|
||||
<div id="user_role_management">
|
||||
<%#= debugger %>
|
||||
<h1>User Role</h1>
|
||||
<%= debugger %>
|
||||
<%= form_tag(polymorphic_path([controller_path.split('/')[0],object,auth.class.name.underscore]),:method => :post) do %>
|
||||
<%= form_tag(submit_url) do %>
|
||||
<%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %>
|
||||
<%= submit_tag 'Add Role' %><br/>
|
||||
<%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %>
|
||||
@@ -16,19 +14,19 @@
|
||||
<% unless auth.nil? %>
|
||||
<% auth.roles.each do |role| %>
|
||||
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %>
|
||||
<%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],:type=>'role',:target_id=>role.id),:method => :delete %></li>
|
||||
<%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'role',:target_id=>role.id),:method => :delete %></li>
|
||||
<% end %>
|
||||
<ul>Sub Roles </ul>
|
||||
<% auth.sub_roles.each do |role| %>
|
||||
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %> </li><%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],:type=>'sub_role',:target_id=>role.id),:method => :delete %>
|
||||
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %> </li><%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'sub_role',:target_id=>role.id),:method => :delete %>
|
||||
<% end %>
|
||||
<ul>PrivilegeList </ul>
|
||||
<% auth.privilege_users.each do |user| %>
|
||||
<li> <%= user.name %> <%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],:type=>'privilege_user',:target_id=>user.id),:method => :delete %> </li>
|
||||
<li> <%= user.name %> <%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'privilege_user',:target_id=>user.id),:method => :delete %> </li>
|
||||
<% end %>
|
||||
<ul>BlockedList </ul>
|
||||
<% auth.blocked_users.each do |user| %>
|
||||
<li> <%= user.name %><%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],:type=>'blocked_user',:target_id=>user.id),:method => :delete %> </li>
|
||||
<li> <%= user.name %><%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'blocked_user',:target_id=>user.id),:method => :delete %> </li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
Reference in new issue
Block a user