def has_privileges(name,
        object_name,
        object_type,
        privileges=None,
        grant_option=None,
        prepend='public',
        maintenance_db=None,
        user=None,
        host=None,
        port=None,
        password=None,
        runas=None):
    object_type, privileges, _privs = _mod_priv_opts(object_type, privileges)

    _validate_privileges(object_type, _privs, privileges)

    if object_type != 'group':
        owner = _get_object_owner(object_name, object_type, prepend=prepend,
            maintenance_db=maintenance_db, user=user, host=host, port=port,
            password=password, runas=runas)
        if owner is not None and name == owner:
            return True

    _privileges = privileges_list(object_name, object_type, prepend=prepend,
        maintenance_db=maintenance_db, user=user, host=host, port=port,
        password=password, runas=runas)

    if name in _privileges:
        if object_type == 'group':
            if grant_option:
                retval = _privileges[name]
            else:
                retval = True
            return retval
        else:
            _perms = _PRIVILEGE_TYPE_MAP[object_type]
            if grant_option:
                perms = dict((_PRIVILEGES_MAP[perm], True) for perm in _perms)
                retval = perms == _privileges[name]
            else:
                perms = [_PRIVILEGES_MAP[perm] for perm in _perms]
                if 'ALL' in _privs:
                    retval = perms.sort() == _privileges[name].keys().sort()
                else:
                    retval = set(_privs).issubset(
                        set(_privileges[name].keys()))
            return retval

    return False
.. versionadded:: 2016.3.0
dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/has_privileges