A Diumenge, 26 de febrer de 2012 19:25:45, Cédric Krier va escriure:
> On 26/02/12 17:46 +0000, [email protected] wrote:
> > Reviewers: ,
> >
> >
> >
> > Please review this at http://codereview.tryton.org/256001/
> >
> > Affected files:
> > M trytond/model/__init__.py
> > A trytond/model/workflow.py
>
> This is a first try. It will be good to discuss the design.
I've been thinking about the design and I think we can make it more generic.
In fact, I think we can fully drop the "workflow" word and talk simply about
security or permissions.
My proposal is to replace "@Workflow.transition('cancel')" with something like
"@Security.check()" and let capabilities to be checked with "ir.rule.group" or
something similar.
So the security rule would need:
- A domain expression
- A group of users
- A model
- A function name
So a function with the decorator of a given model can be executed if domain
expression and group match any of the existing rules.
Opinions?
--
Albert Cervera i Areny
http://www.NaN-tic.com
Tel: +34 93 553 18 03
http://twitter.com/albertnan
http://www.nan-tic.com/blog
--
[email protected] mailing list