Hi Nazar,
You just gotta alias those methods in ability.rb or call the
authorize! method in Your custom action.
https://github.com/ryanb/cancan/#readme
Header: Aliasing Actions
or custom actions:
https://github.com/ryanb/cancan/wiki/custom-actions
https://github.com/ryanb/cancan/wiki/Authorizing-Controller-Actions
or non-restfull controllers:
https://github.com/ryanb/cancan/wiki/Non-RESTful-Controllers
Best,
Marcin
On 24 Lis, 00:36, NazarHussain
<nazarhuss...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi to all.
>
> How can we specify access to the some specific method of a controller.
>
> like we can specify things like:
>
> can :manage, User
>
> if user have two custom methods like , method1 and method2
> and i want to give access to method1 but not to method2
>
> How can i do so?
>
> Waiting for someones response.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.