def user_has_perm(user, perm, obj=None, cache='user'):
 project = _get_object_project(obj)
 if (not project):
  return False
 return (perm in get_user_project_permissions(user, project, cache=cache))

def user_has_perm ( user , perm , obj = None , cache = 'user' ) : project = _get_object_project ( obj ) if ( not project ) : return False return ( perm in get_user_project_permissions ( user , project , cache = cache ) )
cache param determines how memberships are calculated trying to reuse the existing data in cache .