app/soc/views/models/program.py
changeset 1074 94bc2a9ae103
parent 1053 3b9552cf748a
child 1097 1f7015b33a0c
equal deleted inserted replaced
1073:feea88d0e1d8 1074:94bc2a9ae103
    54     """
    54     """
    55 
    55 
    56     rights = access.Checker(params)
    56     rights = access.Checker(params)
    57     rights['any_access'] = ['allow']
    57     rights['any_access'] = ['allow']
    58     rights['show'] = ['allow']
    58     rights['show'] = ['allow']
       
    59     rights['create'] = ['checkIsHost']
       
    60     rights['edit'] = ['checkIsHostForProgram']
       
    61     rights['delete'] = ['checkIsHostForProgram']
    59 
    62 
    60     new_params = {}
    63     new_params = {}
    61     new_params['logic'] = soc.logic.models.program.logic
    64     new_params['logic'] = soc.logic.models.program.logic
    62     new_params['rights'] = rights
    65     new_params['rights'] = rights
    63 
    66 
   141 
   144 
   142     rights.setCurrentUser(id, user)
   145     rights.setCurrentUser(id, user)
   143     filter_args = {}
   146     filter_args = {}
   144 
   147 
   145     for entity in entities:
   148     for entity in entities:
   146       filter_args['scope_path'] = entity.key().name()
   149       filter_args['entity'] = entity
   147       try:
   150       try:
   148         rights.doCheck('checkIsHost', filter_args, [])
   151         rights.doCheck('checkIsProgramActive', filter_args, [])
   149       except out_of_band.Error:
   152       except out_of_band.Error:
   150         continue
   153         continue
   151 
   154 
   152       menu = {}
   155       menu = {}
   153       menu['heading'] = entity.short_name
   156       menu['heading'] = entity.short_name