# \[ANN\] mac\_engine (oh dot pre-pre-alpha)

**URL:** <https://www.ruby-forum.com/t/ann-mac-engine-oh-dot-pre-pre-alpha/93691>\
**Category:** Engines\
**Created:** [April 6, 2006, 5:15pm UTC](https://www.ruby-forum.com/t/ann-mac-engine-oh-dot-pre-pre-alpha/93691 "2006-04-06T17:15:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_AE\_Scott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6bbea6/32.png) [@Vincent\_AE\_Scott](https://www.ruby-forum.com/u/Vincent_AE_Scott)\
**Post date:** [April 6, 2006, 5:15pm UTC](https://www.ruby-forum.com/t/ann-mac-engine-oh-dot-pre-pre-alpha/93691/1 "2006-04-06T17:15:26Z")

</div>

Announcing Model Access Control. (pre-alpha)

Purpose:  
to provide finer grained control over ActiveRecord results than can be  
achieved by using user\_engine. The intention is to provide filtering of  
results and assigning permissions to users/groups over what they can  
access.

Installation:  
Install engines, login\_engine and userstamp first.  
Then run:  
rake db:migrate:engines ENGINE=mac  
rake mac\_bootstrap

Configure your models to use acts\_as\_macable:

class Thing \< ActiveRecord::Base  
acts\_as\_macable  
…  
…  
end

Usage:

p = Person.find\_by\_username(‘me’))  
[Things] = Thing.find\_viewable\_by( p )  
[Things] = Thing.find\_writeable\_by( p )

t = Thing.find(1)  
a = MacAction.find\_by\_permission(‘view’)  
[true|false] t.user\_has\_action( p, a )

So far its quite simplistic and lacking a whole chunk of functionality,  
but its at an initial stage where I feel happy enough showing it to  
everyone else. More stuff will be added and you can expect some of the  
interfaces to change, as i mentioned above its pre-alpha.

How to get it:  
cd $RAILS\_ROOT/vendor/plugins  
svn co svn://codex.net/mac\_engine/trunk mac\_engine

Comments, questions, criticisms and even patches are all welcome 🙂

-v

–  
keys: [http://codex.net/gpg.asc](http://codex.net/gpg.asc)

University: Establishment formerly for education, now for training

---

<div class="post-metadata">

**Author:** ![Vincent\_AE\_Scott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6bbea6/32.png) [@Vincent\_AE\_Scott](https://www.ruby-forum.com/u/Vincent_AE_Scott)\
**Post date:** [April 6, 2006, 6:52pm UTC](https://www.ruby-forum.com/t/ann-mac-engine-oh-dot-pre-pre-alpha/93691/2 "2006-04-06T18:52:19Z")

</div>

Vincent AE Scott wrote:

> Announcing Model Access Control. (pre-alpha)

Sounds good, maybe this is just what I am looking for.  
Will check it out when I find time.  
Can I add find\_\*\*\*able\_by functions myself or are they predefined?

Cheers,  
Martin
