app/soc/views/helper/access.py
changeset 1250 b06e6e014658
parent 1248 f318538394d9
child 1263 34d3f7c756a1
equal deleted inserted replaced
1249:59d1e6b594ae 1250:b06e6e014658
   686     new_args = {'scope_path': program.scope_path }
   686     new_args = {'scope_path': program.scope_path }
   687     self.checkHasActiveRoleForScope(new_args, host_logic)
   687     self.checkHasActiveRoleForScope(new_args, host_logic)
   688 
   688 
   689   @allowDeveloper
   689   @allowDeveloper
   690   @denySidebar
   690   @denySidebar
       
   691   def checkIsHostForProgramInScope(self, django_args):
       
   692     """Checks if the user is a host for the specified program.
       
   693     """
       
   694 
       
   695     program = program_logic.getFromKeyName(django_args['scope_path'])
       
   696 
       
   697     if not program or program.status == 'invalid':
       
   698       raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_PROGRAM_MSG)
       
   699 
       
   700     django_args = {'scope_path': program.scope_path}
       
   701     self.checkHasActiveRoleForScope(django_args, host_logic)
       
   702 
       
   703   @allowDeveloper
       
   704   @denySidebar
   691   def checkIsActivePeriod(self, django_args, period_name, key_name_arg):
   705   def checkIsActivePeriod(self, django_args, period_name, key_name_arg):
   692     """Checks if the given period is active for the given program.
   706     """Checks if the given period is active for the given program.
   693     
   707     
   694     Args:
   708     Args:
   695       django_args: a dictionary with django's arguments.
   709       django_args: a dictionary with django's arguments.