launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #03921
Re: Permission checks in the model (was: Re: warning: we will soon have much noise in the test results...)
On July 26, 2010, James Westby wrote:
> - What I did?
> - Don't do this in the model?
> - Change the API so that check_permission works?
> - Use the security.py code, possibly writing a helper to get an
> interaction for a person without logging them in, and passing this
> to checkAuthenticated().
> - Something else?
The current "best pattern" we have is:
- Move the logic in security.py that checks if somebody is a driver to a
method on the model.
- Call that method for the security checker.
- Call that method from your model code.
--
Francis J. Lacoste
francis.lacoste@xxxxxxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part.
References