[openstreetmap/openstreetmap-website] Initial cut at authorization patterns (#1904)

Andy Allan notifications at github.com
Wed Oct 3 09:11:25 UTC 2018


gravitystorm commented on this pull request.



> @@ -102,7 +103,9 @@ def copyright
     @locale = params[:copyright_locale] || I18n.locale
   end
 
-  def welcome; end
+  def welcome
+    require_user

Could you explain this bit for me? My thoughts were that using CanCanCan would be to remove uses of our home-grown require_user/admin/moderator from the code. My approach would be to change the authorisation rules to have `can [:welcome], :site` in the "if user" section, rather than putting it in the 'all users' section and then adding a restriction here. Have I overlooked something?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1904#pullrequestreview-161072540
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20181003/eecf08f2/attachment.html>


More information about the rails-dev mailing list