def security_group_count_by_project(context, project_id):
    authorize_project_context(context, project_id)
    return model_query(context, models.SecurityGroup, read_deleted="no").\
                   filter_by(project_id=project_id).\
                   count()
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.