So i have been building a rails app that is based around a post model. On this website i write articles about different topics and now i want to restrict access to certain articles based on 1) They are logged in and registered and 2) they belong to the right group and are allowed to read that article.
I'm using devise and i have created a user model. I have also added Rolify to handle the roles and Authority to tie it together.
At the moment i can restrict access to a page by forcing the reader to be logged in.. but that doesn't really solve the whole problem. I can't seem to get it to check what group the person belongs to and as long as the person is logged in it doenst care role that person has. How do i ties this into my controllers etc? If someone has experience in using these gems and knows what i might be doing wrong please help me
I don't know if they way i'm going about this is the right way.. and i would love to get some feedback on the best way of doing this.