def are_permissions_roles_seeded(course_id):
 try:
  administrator_role = Role.objects.get(name=FORUM_ROLE_ADMINISTRATOR, course_id=course_id)
  moderator_role = Role.objects.get(name=FORUM_ROLE_MODERATOR, course_id=course_id)
  student_role = Role.objects.get(name=FORUM_ROLE_STUDENT, course_id=course_id)
 except:
  return False
 for per in STUDENT_ROLE_PERMISSIONS:
  if (not student_role.has_permission(per)):
   return False
 for per in (MODERATOR_ROLE_PERMISSIONS + STUDENT_ROLE_PERMISSIONS):
  if (not moderator_role.has_permission(per)):
   return False
 for per in ((ADMINISTRATOR_ROLE_PERMISSIONS + MODERATOR_ROLE_PERMISSIONS) + STUDENT_ROLE_PERMISSIONS):
  if (not administrator_role.has_permission(per)):
   return False
 return True

def are_permissions_roles_seeded ( course_id ) : try : administrator_role = Role . objects . get ( name = FORUM_ROLE_ADMINISTRATOR , course_id = course_id ) moderator_role = Role . objects . get ( name = FORUM_ROLE_MODERATOR , course_id = course_id ) student_role = Role . objects . get ( name = FORUM_ROLE_STUDENT , course_id = course_id ) except : return False for per in STUDENT_ROLE_PERMISSIONS : if ( not student_role . has_permission ( per ) ) : return False for per in ( MODERATOR_ROLE_PERMISSIONS + STUDENT_ROLE_PERMISSIONS ) : if ( not moderator_role . has_permission ( per ) ) : return False for per in ( ( ADMINISTRATOR_ROLE_PERMISSIONS + MODERATOR_ROLE_PERMISSIONS ) + STUDENT_ROLE_PERMISSIONS ) : if ( not administrator_role . has_permission ( per ) ) : return False return True
returns whether the forums permissions for a course have been provisioned in the database .