human
Complete the below
def _has_access_string(user, action, perm):

    ''''Check if user has certain special access, specified as string.  Valid strings:
    \'global\'
    Valid actions:
    \'staff\' -- global staff access.
    \'support\' -- access to student support functionality
    \'certificates\' --- access to view and regenerate certificates for other users.'
    '''
 ... Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    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)