Per-User basis security with restful_authentication in Rails ?
Posted
by benoror
on Stack Overflow
See other posts from Stack Overflow
or by benoror
Published on 2010-04-23T02:42:29Z
Indexed on
2010/04/23
2:43 UTC
Read the original article
Hit count: 521
Hi! I'm using restful_authentication plugin, but I would like to have per-user security, for example:
class PostsController < ApplicationController
# Login required
before_filter :login_required, :except => [ :index, :show ]
# Only the same user can create, edit and delete their own posts
before_filter :only_by_same_user, :only => [ :create, :update, :destroy ]
end
Thanks!
© Stack Overflow or respective owner