parameters: (self)
docstring: check access for each element
docstring_summary: check access for each element
docstring_tokens: check access for each element
function: def check_access(self):
          '''check access for each element'''
          
          
          project_code = Project.get_project_code() 
          security = Environment.get_security()
          
          element_names = ['assigned','status']
          search_type = 'sthpw/task'
          for element_name in element_names:
            
              
              def_default_access = 'edit'
              
              
              # check security access
              access_key2 = {
                  'search_type': search_type,
                  'project': project_code
              }
              access_key1 = {
                  'search_type': search_type,
                  'key': element_name, 
                  'project': project_code
  
              }
              access_keys = [access_key1, access_key2]
              is_viewable = security.check_access('element', access_keys, "view", default=def_default_access)
              is_editable = security.check_access('element', access_keys, "edit", default=def_default_access)
              self.permission[element_name] = {'is_viewable': is_viewable, 'is_editable': is_editable}
function_tokens: def check_access ( self ) : project_code = Project . get_project_code ( ) security = Environment . get_security ( ) element_names = [ 'assigned' , 'status' ] search_type = 'sthpw/task' for element_name in element_names : def_default_access = 'edit' # check security access access_key2 = { 'search_type' : search_type , 'project' : project_code } access_key1 = { 'search_type' : search_type , 'key' : element_name , 'project' : project_code } access_keys = [ access_key1 , access_key2 ] is_viewable = security . check_access ( 'element' , access_keys , "view" , default = def_default_access ) is_editable = security . check_access ( 'element' , access_keys , "edit" , default = def_default_access ) self . permission [ element_name ] = { 'is_viewable' : is_viewable , 'is_editable' : is_editable }