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 

 University: Establishment formerly for education, now for training

_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to