Deb,<br><br>This looks great! I like how it came out. I&#39;m glad we have the flexibility to load from anywhere in RAILS_ROOT too since they might be running from a gem, in which case they will want to load from elsewhere. What you have here gives us that flexibility.
<br><br>So commit when you are ready.<br><br>Jeff<br><br><div><span class="gmail_quote">On 2/13/07, <b class="gmail_sendername">Deb Lewis</b> &lt;<a href="mailto:djlewis@acm.org">djlewis@acm.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jeff - I reworked your initial version of allowing app developers to<br>customize the MasterView admin auth checking, per our discussions of<br>factoring and use of mixins.<br><br>Before I commit, see below for summary of the new version.
<br><br>~ Deb<br><br>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br><br>By default, the MV admin controller restricts access to local requests<br>(essentially, developer testing configuration).<br><br>To provide customized access checking for your application, you can override
<br>the default auth checking by providing a mixin module for the MV admin<br>controller which implements a predicate method named allow_access?.&nbsp;&nbsp;The<br>mixin is installed in an ApplicationController subclass, so your<br>
allow_access? method has access to all standard Rails controller services as<br>well as any services defined in your ApplicationController (notably your own<br>authentication and authorization methods).<br><br>By default, if you implement your mixin as module MasterViewAdminAuthMixin
<br>and place it in file admin_auth_mixin.rb in your rails app/masterview<br>directory (alongside any custom directives in app/masterview/directives),<br>MasterView will automatically install your allow_access? method in the admin
<br>controller&#39;s auth check.<br><br>If you want to use a different module name or load the mixin module from a<br>different location, specify this information in the MasterView<br>admin_auth_mixin config setting in your config/masterview/settings.rb or
<br>env-specific settings.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;# To load a different file from app/masterview or use a different module<br>name:<br>&nbsp;&nbsp;&nbsp;&nbsp;#<br>&nbsp;&nbsp;&nbsp;&nbsp;# config.admin_auth_mixin = {<br>&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp; :file =&gt; &#39;alt_admin_auth_mixin&#39;, # module file in
<br>#{RAILS_ROOT}/app/masterview dir<br>&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp; :module =&gt; :AltMasterViewAdminAuthMixin, # default is<br>:MasterViewAdminAuthMixin<br>&nbsp;&nbsp;&nbsp;&nbsp;# }<br>&nbsp;&nbsp;&nbsp;&nbsp;#<br>&nbsp;&nbsp;&nbsp;&nbsp;# To load a mixin from the rails app&#39;s lib directory:<br>
&nbsp;&nbsp;&nbsp;&nbsp;#<br>&nbsp;&nbsp;&nbsp;&nbsp;# config.admin_auth_mixin = {<br>&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp; :file =&gt; &#39;lib/custom/mv_admin_auth_mixin&#39;, # module file in rails<br>lib dir<br>&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp; :file_loc =&gt; :RAILS_ROOT,&nbsp;&nbsp;# default location for rel refs is<br>
#{RAILS_ROOT}/app/masterview<br>&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp; :module =&gt; :CustomMasterViewAdminAuthMixin, # default is<br>:MasterViewAdminAuthMixin<br>&nbsp;&nbsp;&nbsp;&nbsp;# }<br><br>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br><br><br>_______________________________________________
<br>Masterview-devel mailing list<br><a href="mailto:Masterview-devel@rubyforge.org">Masterview-devel@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/masterview-devel">http://rubyforge.org/mailman/listinfo/masterview-devel
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Barczewski, MasterView core team<br>Inspired Horizons Ruby on Rails Training and Consultancy<br>Next Ruby on Rails plus JRuby workshop Feb 22-24 St. Louis, MO
<br><a href="http://inspiredhorizons.com/training/rails/index.html">http://inspiredhorizons.com/training/rails/index.html</a>