ACK w/ a couple small nits in permission controller below

On 03/29/2010 02:03 PM, Scott Seago wrote:
> The views will change with the coming redesign, and backlinks _from_ the 
> permission pages back to the pool/account/etc pages are not yet defined.
>
> Signed-off-by: Scott Seago<[email protected]>
> ---
>   src/app/controllers/application_controller.rb |    2 +
>   src/app/controllers/permissions_controller.rb |   90 
> +++++++++++++++++++++++++
>   src/app/models/cloud_account.rb               |    4 +
>   src/app/views/layouts/_main_nav.html.erb      |    1 +
>   src/app/views/permissions/list.html.erb       |   34 +++++++++
>   src/app/views/permissions/new.html.erb        |   17 +++++
>   src/app/views/portal_pool/accounts.html.erb   |    8 ++
>   src/app/views/portal_pool/show.html.erb       |    3 +-
>   src/app/views/provider/show.html.erb          |    1 +
>   9 files changed, 159 insertions(+), 1 deletions(-)
>   create mode 100644 src/app/controllers/permissions_controller.rb
>   create mode 100644 src/app/views/permissions/list.html.erb
>   create mode 100644 src/app/views/permissions/new.html.erb
>
> diff --git a/src/app/controllers/application_controller.rb 
> b/src/app/controllers/application_controller.rb
> index d7b135b..a71f53d 100644
> --- a/src/app/controllers/application_controller.rb
> +++ b/src/app/controllers/application_controller.rb
> @@ -61,6 +61,8 @@ class ApplicationController<  ActionController::Base
>     end
>     master_helper_module.module_eval perm_helper_string
>
> +  helper_method :check_privilege
> +
>     protected
>     # permissions checking
>
> diff --git a/src/app/controllers/permissions_controller.rb 
> b/src/app/controllers/permissions_controller.rb
> new file mode 100644
> index 0000000..257f2b1
> --- /dev/null
> +++ b/src/app/controllers/permissions_controller.rb
> @@ -0,0 +1,90 @@
> +#
> +# Copyright (C) 2009 Red Hat, Inc.
>    
s/2009/2010

> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; version 2 of the License.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> +# MA  02110-1301, USA.  A copy of the GNU General Public License is
> +# also available at http://www.gnu.org/copyleft/gpl.html.
> +
> +# Filters added to this controller apply to all controllers in the 
> application.
> +# Likewise, all the methods added will be available for all controllers.
>    
Remove this comment, belongs in application controller but not here.

> +
> +class PermissionsController<  ApplicationController
> +  before_filter :require_user
> +
> +  def show
> +    @permission = Permission.find(params[:id])
> +    require_privilege(Privilege::PERM_VIEW, @permission.permission_object)
> +  end
>    

This action doesn't seem to have a template or a link to it anywhere. 
Not really intrusive and fine as is though.


Everything else looks great. ACK.

     -Mo
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to