Authorization to update a model attribute.

3 views
Skip to first unread message

Arthur

unread,
Feb 3, 2009, 1:36:23 PM2/3/09
to declarative_authorization
Hi, thanks for your plugin.

For a project of mine, I may need to have something more specific that
CRUD rights on records.
I want read and update rights per attributes for some of them.

Did you know some plugins that do that,
or do you think that this feature could be added to
declarative_authorization ? (by me or someone else...)

Thanks,
Arthur

Steffen Bartsch

unread,
Feb 3, 2009, 2:11:30 PM2/3/09
to declarative_...@googlegroups.com, Arthur
Hi Arthur,

Am Dienstag, 3. Februar 2009 schrieb Arthur:
> For a project of mine, I may need to have something more specific that
> CRUD rights on records.
> I want read and update rights per attributes for some of them.

It obviously depends on the granularity that you need. One simpler solution
is to separate the models into a model hierarchy (using STI). Thus, you
could define permissions on different models again.

> Did you know some plugins that do that,

I'm not aware of any plugin that specifically does that. I haven't
specifically sought for that, yet, though.

> or do you think that this feature could be added to
> declarative_authorization ? (by me or someone else...)

There are two parts to this. On the one hand, one needs to define a syntax
for the authorization rules.

The second part is the actual checking of the attributes. For named scopes
this is quite difficult, I'd say, as we currently only rewrite the query for
additional conditions.

For checking before any update or create, this should be fairly straight
forward.

I can't currently imagine how attribute-based restrictions would work on the
controller level.

Steffen

signature.asc
Reply all
Reply to author
Forward
0 new messages