First of all you don't want a gem, you are going to have to write your own code.
that logic can be automagically implied without me having to check it
manually in every method that requires it?
That's what before_filters do. You will most likely already have one set up in your application_controller.rb. A before filter will ensure that the authorize method is called before every action that needs it
See here unde section 7 Filters for more details on this
http://guides.rubyonrails.org/action_controller_overview.html
Lastly, I hope you are not implying that xml post requests to update a profile should not log in! They surely should, http basic authentication will handle this for you.
See here
http://api.rubyonrails.org/classes/ActiveResource/Base.html
Also for Rails => v 3.1
http://railscasts.com/episodes/270-authentication-in-rails-3-1
Update
It is clear from the comments below that it is not obvious how the suggestions I have provided help solve you problem
So here is how you could use the above information.
A before filter in the application controller will ensure that the current user is ok so you don't need to check your controller params for a user id being == to the current users user id.
Secondly, if you want to know if a user is allowed to do a specific thing then add a method to the user class. something like
def can_do_something?
#Put your code here to check if something is allowed for this specific user
end
Then instead of
if params[:user_id] == current_user.id
# allow update!
else
# don't allow update
You add a validation to the model that you are trying to update (which is probably related to the user in some way) then you need no additional controller code at all above the authorization and authentication checks to deal with this or if that's not a good fit and you really have to put code in your controller then do this
if current_user.can_do_something?
# allow update!
else
# don't allow update