def has_database_privileges(cursor, user, db, privs):
 cur_privs = get_database_privileges(cursor, user, db)
 have_currently = cur_privs.intersection(privs)
 other_current = cur_privs.difference(privs)
 desired = privs.difference(cur_privs)
 return (have_currently, other_current, desired)

def has_database_privileges ( cursor , user , db , privs ) : cur_privs = get_database_privileges ( cursor , user , db ) have_currently = cur_privs . intersection ( privs ) other_current = cur_privs . difference ( privs ) desired = privs . difference ( cur_privs ) return ( have_currently , other_current , desired )
return the difference between the privileges that a user already has and the privileges that they desire to have .