human
Complete the below
def check_has_write_access_permission(view_func):

    ''''Decorator ensuring that the user is not a read only user.'
    '''

Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    def decorate(request, *args, **kwargs):
        if (not has_write_access(request.user)):
            raise PopupException(_('You    are    not    allowed    to    modify    the    metastore.'), detail=_('You    have    must    have    metastore:write    permissions'), error_code=301)
        return view_func(request, *args, **kwargs)
    return wraps(view_func)(decorate)