Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed the controller and the views (will do an extra plugin)

  • Loading branch information...
commit ef9c80c8505ee7eaa74e4b24bd7b8f30b3e673f2 1 parent 077a092
@pschrammel authored
View
2  README.rdoc
@@ -304,7 +304,7 @@ is/will be setup at http://github.com/popel/active_acl_plus_rspec/tree/master .
in no particular order, just a reminder...
-* add materialized_tree_support
+* add materialized_tree support
* use Moneta as key/value store
* direct PostgreSQL interface
* example on how to integrate with authentication
View
55 app/controllers/privileges_controller.rb
@@ -1,55 +0,0 @@
-class PrivilegesController < ApplicationController
- verify :method => :post, :only => [ :create, :update],
- :redirect_to => { :action => :list }
-
- def index
- redirect_to :action => :list
- end
-
- def list
- @privileges = ActiveAcl::Privilege.find(:all, :order => 'section ASC, value ASC')
- end
-
- def edit
- redirect_to :action => :list and return false unless params[:id]
- begin
- @privilege = ActiveAcl::Privilege.find(params[:id])
- rescue ActiveRecord::RecordNotFound => e
- flash[:error] = 'Privilege not found'
- redirect_to :action => :list and return false
- end
- end
-
- def update
- redirect_to :action => :list and return false if params['commit'] == 'Cancel'
-
- begin
- @privilege = ActiveAcl::Privilege.find(params[:id].to_i)
- rescue ActiveRecord::RecordNotFound => e
- flash[:error] = 'Privilege not found'
- redirect_to :action => :list and return false
- end
-
- if (@privilege.update_attributes(params[:privilege]))
- flash[:success] = 'Privilege successfully updated'
- redirect_to :action => :list and return false
- else
- flash.now[:error] = 'There was an error updating the Privilege'
- @title = 'Edit Privilege'
- render :action => :edit
- end
- end
-
- def delete
- redirect_to :action => :list and return false unless params[:id]
- begin
- privilege = ActiveAcl::Privilege.find(params[:id])
- privilege.destroy
- flash[:success] = 'Privilege successfully deleted'
- rescue ActiveRecord::RecordNotFound => e
- flash[:error] = 'Privilege not found'
- end
-
- redirect_to :action => :list and return false
- end
-end
View
14 app/view/privileges/_privilege_form.rhtml
@@ -1,14 +0,0 @@
-<table border="0">
- <tr>
- <td>Section:</td>
- <td><%= text_field 'permission', 'section' %></td>
- </tr>
- <tr>
- <td>Value:</td>
- <td><%= text_field 'permission', 'value' %></td>
- </tr>
- <tr>
- <td>Description:</td>
- <td><%= text_field 'permission', 'description' %></td>
- </tr>
-</table>
View
17 app/view/privileges/edit.rhtml
@@ -1,17 +0,0 @@
-<html>
-<body>
-<% if flash[:error] %>
- <p class="error"><%=h flash[:error] %></p>
- <% elsif flash[:notice] %>
- <p class="notice"><%=h flash[:notice] %></p>
- <% elsif flash[:success] %>
- <p class="notice"><%=h flash[:success] %></p>
- <% else %>
- <p>&nbsp;</p>
- <% end %>
- <%= form_tag({ :action => 'update', :id => @permission.id }) %>
- <%= render_partial 'permission_form' %>
- <%= submit_tag 'Save' %> <%= submit_tag 'Cancel' %>
- </form>
-</body>
-</html>
View
39 app/view/privileges/list.rhtml
@@ -1,39 +0,0 @@
-<html>
-<body>
-<% if flash[:error] %>
- <p class="error"><%=h flash[:error] %></p>
- <% elsif flash[:notice] %>
- <p class="notice"><%=h flash[:notice] %></p>
- <% elsif flash[:success] %>
- <p class="notice"><%=h flash[:success] %></p>
- <% else %>
- <p>&nbsp;</p>
- <% end %>
-<table border="0" cellpadding="5">
- <tr>
- <th>Section/Value</th>
- <th>Description</th>
- <th>&nbsp;</th>
- </tr>
-<% oldsection = nil %>
-<% for permission in @permissions do %>
- <% if permission.section != oldsection and oldsection != nil %>
- <tr><td colspan="3">&nbsp;</td></tr>
- <% end %>
- <% unless permission.section == oldsection %>
- <tr>
- <td colspan="3"><b><%=h permission.section %></b></td>
- </tr>
- <% oldsection = permission.section %>
- <% end %>
- <tr>
- <td><img src="/engine_files/gacl_engine/spacer.gif" height="1" width="20"><%= link_to permission.value, :action => 'edit', :id => permission.id %></td>
- <td><%=h permission.description %></td>
- <td>
- <small>[<%= link_to 'delete', {:action => 'delete', :id => permission.id }, {:confirm => 'Shure to delete this Permission?'} %>]</small>
- </td>
- </tr>
-<% end %>
-</table>
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.