diff options
-rw-r--r-- | app/models/user.rb | 11 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 2 | ||||
-rw-r--r-- | config/general.yml-example | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 59f6c971c..4a68d60d1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -246,6 +246,11 @@ class User < ActiveRecord::Base # Does the user magically gain powers as if they owned every request? # e.g. Can classify it def owns_every_request? + self.super? + end + + # Does this user have extraordinary powers? + def super? self.admin_level == 'super' end @@ -255,18 +260,18 @@ class User < ActiveRecord::Base # Can the user see every request, even hidden ones? def User.view_hidden_requests?(user) - !user.nil? && user.admin_level == 'super' + !user.nil? && user.super? end # Should the user be kept logged into their own account # if they follow a /c/ redirect link belonging to another user? def User.stay_logged_in_on_redirect?(user) - !user.nil? && user.admin_level == 'super' + !user.nil? && user.super? end # Does the user get "(admin)" links on each page on the main site? def admin_page_links? - self.admin_level == 'super' + self.super? end # Is it public that they are banned? def public_banned? diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 0dd493fd0..7b4c0f6a1 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -139,7 +139,7 @@ <input type="text"> </div> <% - unless Configuration::ga_code.empty? %> + unless Configuration::ga_code.empty? || (@user && @user.super?) %> <script> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); diff --git a/config/general.yml-example b/config/general.yml-example index 9646e45c8..1b30ffce6 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -160,7 +160,7 @@ MAX_REQUESTS_PER_USER_PER_DAY: 6 # unset if you aren't running behind varnish VARNISH_HOST: localhost -# Adding a value here will enable Google Analytics on all non-admin pages. +# Adding a value here will enable Google Analytics on all non-admin pages for non-admin users. GA_CODE: '' # If you want to override *all* the public body request emails with your own |