def _has_access_string(user, action, perm):
 def check_staff():
  '\n        Checks for staff access\n        '
  if (perm != 'global'):
   debug("Deny: invalid permission '%s'", perm)
   return ACCESS_DENIED
  return (ACCESS_GRANTED if GlobalStaff().has_user(user) else ACCESS_DENIED)
 def check_support():
  'Check that the user has access to the support UI. '
  if (perm != 'global'):
   return ACCESS_DENIED
  return (ACCESS_GRANTED if (GlobalStaff().has_user(user) or SupportStaffRole().has_user(user)) else ACCESS_DENIED)
 checkers = {'staff': check_staff, 'support': check_support, 'certificates': check_support}
 return _dispatch(checkers, action, user, perm)

def _has_access_string ( user , action , perm ) : def check_staff ( ) : if ( perm != 'global' ) : debug ( "Deny: invalid permission '%s'" , perm ) return ACCESS_DENIED return ( ACCESS_GRANTED if GlobalStaff ( ) . has_user ( user ) else ACCESS_DENIED ) def check_support ( ) : if ( perm != 'global' ) : return ACCESS_DENIED return ( ACCESS_GRANTED if ( GlobalStaff ( ) . has_user ( user ) or SupportStaffRole ( ) . has_user ( user ) ) else ACCESS_DENIED ) checkers = { 'staff' : check_staff , 'support' : check_support , 'certificates' : check_support } return _dispatch ( checkers , action , user , perm )
check if user has certain special access .