On September 9 Catón posted a link to to a tutorial.
http://groups.google.com/group/acl9-discuss/browse_thread/thread/d13dfb38c0b6955e
Which I found very helpful. Thank you, Lucas.
His tutorial has Example A in a controller, wheras Example B is more
like the canonical example from the rdoc.
Based on my sandbox, both work. Is there a benefit to one approach
over another?
Example A
class StaticContentController < ApplicationController
access_control do
allow all, :to => [:index]
allow anonymous, :to => [:index2]
allow logged_in, :to => [:index2, :index3]
allow :admin, :to => [:index4]
User.find(2).has_role! :admin
end
def index
end
Example B
class StaticContentController < ApplicationController
access_control do
action :index do
allow all
end
action :index2 do
allow anonymous, logged_in
end
action :index3 do
allow logged_in
end
action :index4 do
allow :admin
end
User.find(2).has_role! :admin
end
def index
end
--
Brian Dunbar
Geidus
"Display some adaptability"
there's no particular advantage in any approach, they get translated
into roughly the same code.
So use what you like.
12.10.2009, в 3:41, Brian Dunbar написал(а):
~brian