Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1663] Add authorization and validation to activity_create() logic a…
…ction function activity_create() logic action function now checks authorization and does validation. Has an ignore_auth argument (default: False) which if True will skip the authorization. Other logic functions that call activity_create() as a side-effect (and after doing their own authorization, if any) pass ignore_auth=True to activity_create(). Also made those other logic functions explicitly construct an activity_create_context dict instead of just passing in their own context dicts. This way unwanted stuff such as the calling function's schema does not get passed into activity_create(), and the logic functions also put 'defer_commit' into activity_create_context because they want to do their own commit later. The user_create() logic action function now flushes the session before calling activity_create() so that the new user's id is initialised. This bug wasn't showing itself before when activity_create() didn't do any validation. Added activity_create() logic auth function, just authorizes only sysadmins to create activities. Add default_create_activity_schema() to validate activity dicts, and add user_id_exists(), group_id_exists(), activity_type_exists() and object_id_validator() validator functions.
- Loading branch information
Sean Hammond
committed
Jan 27, 2012
1 parent
28ffe57
commit 02b7edd
Showing
6 changed files
with
157 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters