diff -r 59d1e6b594ae -r b06e6e014658 app/soc/views/helper/access.py --- a/app/soc/views/helper/access.py Sat Feb 07 22:56:15 2009 +0000 +++ b/app/soc/views/helper/access.py Sat Feb 07 23:26:38 2009 +0000 @@ -688,6 +688,20 @@ @allowDeveloper @denySidebar + def checkIsHostForProgramInScope(self, django_args): + """Checks if the user is a host for the specified program. + """ + + program = program_logic.getFromKeyName(django_args['scope_path']) + + if not program or program.status == 'invalid': + raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_PROGRAM_MSG) + + django_args = {'scope_path': program.scope_path} + self.checkHasActiveRoleForScope(django_args, host_logic) + + @allowDeveloper + @denySidebar def checkIsActivePeriod(self, django_args, period_name, key_name_arg): """Checks if the given period is active for the given program.