top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Session variable in default_scope with rails App

+1 vote
339 views

I have a project model which I'd like to set the default_scope to filter out projects where the user doesn't have permission to view them.

Think something along the lines of the projects having a list of teams and companies that the user must be in to access the data.

default_scope seems to work well if I hard code it as I really don't want a dev to accidentally not have these permissions filters in use. The lists of teams and companies a user is in is stored in the session.

posted Aug 12, 2013 by Anderson

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

Is it is possible to share a Rails 4 session with a Rails 4.1 application with the same secret key base on the same domain name. This works with Rails 4 to Rails 4 but it appears that my cookies are being encrypted differently between the two versions.

Any suggestions?

+1 vote

I am trying to figure out if I can run my sessionpersistence script that I run with Apache to see if sessions persist between two tomcat sites on two separate servers. The load balancer has session persistence enabled but Iam unsure how to test it. My thought was that I would just add the following php script to check, but apparently I am doing something wrong. The script is this:

but it seems not to like it if I add it from the webapps directory or from inside a directory under that. Is there some special trick to running php from inside tomcat ? I have tomcat set up the same on both servers and am fronting it with Apache if that adds options for me.

+2 votes

I have found a html template where I some pages need specific css files and of course there are some common css files.

How can I best deal with it ?

+2 votes

I'm having a problem getting my objects out of the $SESSION variable. I am storing an ordinal array of associate arrays where one of the associate array elements is an object. Unfortunately, when I pull it back out, the object is "broken" with "__PHP_Incomplete_Class" errors.

From what I can read this has something to do with 'serialization' - i.e., the emerging object must be unserialized (http://php.net/manual/en/function.unserialize.php ). However, I can't get it to work.

Any tips on how that is done, or what I should do instead?

This program is being developed on a testing server that can then be put on a production server.

Here are my server specs:
Apache Version : 2.2.17
PHP Version : 5.3.3
MySQL Version : 5.5.8

...