Ruby on Rails - class caching? -
I read an article and I used the principles given there for writing administrative checks for my controllers. Actually, you see which controller you are in and then I say an array that if this person allows permission to see that controller, then pass it.
The author of the article said that the readers should not use the example code because it was faulty and should use their plugin (which is definitely outdated now). And they said
"There are some problems with the above code while running in production mode due to the use of class variables and class caching."
I have a test unsuccessful and I think it may be because of this, but I am not sure which part of the code I should not use. I had the following (in application.rb):
controller = consultation [: controller] action = param [: verb]
but I changed it From:
controller = self.class.name action = param [: verb]
How can I use the verb name correctly? And what kind of things can you do in the development mode that you can not do in production?
Have you considered a role-based permissions plugin instead? See the following Stavevrfollow question:
I am unaware of any issues with the use of the code you pasted. In question, the plugin may possibly be misused @@ due to some issues, however, I have not inspected it completely.
Comments
Post a Comment