I use devise and cancancan for login and roles.

In my little rails app generator project: https://github.com/dgleba/bashrail 
 there are scripts for this. Even if you don't use the scripts, they 
document exactly how to implement it in that case.

look at:  
https://github.com/dgleba/bashrail/blob/master/devise1.sh
https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just 
what is needed to create an app with the feature I am studing.

I am not sure about the  "give each RoR user the ability to write their own 
SQL statements ".
Is that just a model/view/controller in your app? If so, the above should 
work for that too.

Can you share how you did the "give each RoR user the ability to write 
their own SQL statements "? I may want to do the same.



On Tuesday, July 11, 2017 at 11:39:13 PM UTC-4, Ralph Shnelvar wrote:
>
> I have a database with a large table.
>
> I have several users each of whom should have read-only rights to the 
> large table but has read/wrtie rights to their own table(s) but not to each 
> others table(s).
>
> Adding to the complication, I want to give each RoR user the ability to 
> write their own SQL statements against the large table as well as their own 
> table(s).  I have successfully implemented being able to have them enter 
> sql statements and create results they can view and/or download.  Doing 
> that is not my question.
>
> I want to make sure each of my "readonly" users can't modify any tables 
> they are not authorized to see and/or change.
>
> So,I guess, I want to change Postgres roles within Rails.  Any guidance 
> would, of course, be appreciated.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d00f4681-e13c-4d0f-af07-bc4835467849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to