# Restrict specific model columns per user

**URL:** <https://www.ruby-forum.com/t/restrict-specific-model-columns-per-user/58497>\
**Category:** Rails\
**Created:** [April 22, 2006, 5:48am UTC](https://www.ruby-forum.com/t/restrict-specific-model-columns-per-user/58497 "2006-04-22T05:48:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjrussell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jjrussell](https://www.ruby-forum.com/u/jjrussell)\
**Post date:** [April 22, 2006, 5:48am UTC](https://www.ruby-forum.com/t/restrict-specific-model-columns-per-user/58497/1 "2006-04-22T05:48:42Z")

</div>

Does anyone know a way to restrict access to specific columns in the  
model to specific users? My plan was to use the session hash to check  
the permissions of the logged in user in an overridden method of the  
same name as the model accessor I wanted to restrict, but the model  
can’t acecss the session. Any other ideas?

---

<div class="post-metadata">

**Author:** ![jjrussell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jjrussell](https://www.ruby-forum.com/u/jjrussell)\
**Post date:** [April 22, 2006, 7:14am UTC](https://www.ruby-forum.com/t/restrict-specific-model-columns-per-user/58497/2 "2006-04-22T07:14:46Z")

</div>

Hi John,

Not sure if this is what you’re after, but it might be worth a peek:  
[http://perens.com/FreeSoftware/ModelSecurity/](http://perens.com/FreeSoftware/ModelSecurity/)

Cheers,  
Brian

---

<div class="post-metadata">

**Author:** ![jjrussell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jjrussell](https://www.ruby-forum.com/u/jjrussell)\
**Post date:** [April 23, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/restrict-specific-model-columns-per-user/58497/3 "2006-04-23T16:15:56Z")

</div>

This looks very promising. Thanks a lot.
