On Wed, Jul 06, 2011 at 02:45:24AM -0400, Scott Seago wrote:
Most of Bug 714790 has been pushed, but the remaining issue was that
non-admin users, when clicking the 'administer' tab would result in an
'insufficient privileges' error.
As it turns out, the default action for 'administer' was the 'users'
list, which happened to be the only 'administer' action that doesn't allow
non-admin users from viewing the page at all. In other cases, normal users should get
viewing (but not editing) rights -- HWPs, Realms, and Suggested deployables. In some,
(providers, etc) the action is valid but the results list is filtered by permissions.
This is only a temporary fix, since UX design for 'administer' hasn't been
done yet. I'm changing the default action to view 'Suggested Deployables'
instead of 'Users', as everyone can see that. In addition, the nav pulldown
filters 'Users' section is now conditionally included based on the same
permissions check that complains if non-admin users attempt to navigate there. I'm not
enforcing permissions in nav anywhere else, since the pages themselves don't enforce
them.
Signed-off-by: Scott Seago <sseago(a)redhat.com>
---
src/app/views/layouts/_admin_header.haml | 3 ++-
src/app/views/layouts/application.haml | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/app/views/layouts/_admin_header.haml
b/src/app/views/layouts/_admin_header.haml
index ebae58c..37f6a90 100644
--- a/src/app/views/layouts/_admin_header.haml
+++ b/src/app/views/layouts/_admin_header.haml
@@ -9,7 +9,8 @@
%label.label.small{:for => 'admin-section-select'} Control Panels
%select#admin-section-select
%option{:value => users_path} Choose section...
- %option{:value => users_path} Users
+ - if check_privilege(Privilege::VIEW, User)
+ %option{:value => users_path} Users
%option{:value => roles_path} Roles
%option{:value => providers_path} Providers
%option{:value => provider_accounts_path} Provider Accounts
diff --git a/src/app/views/layouts/application.haml
b/src/app/views/layouts/application.haml
index 443af7f..edeba61 100644
--- a/src/app/views/layouts/application.haml
+++ b/src/app/views/layouts/application.haml
@@ -37,7 +37,7 @@
%li{:class => "#{'active' unless [:design,
:administer].include? controller.top_section}" }
= link_to 'Monitor', pools_path
%li{:class => "#{'active' if controller.top_section ==
:administer}" }
- = link_to 'Administer', users_path
+ = link_to 'Administer', suggested_deployables_path
#content
-# works with any 960 container (.container_16 or .container_24)
ACK. All options on that page are now things I have access to view.
-- Matt