def check_read_permissions(self, instance): entity = entities_service.get_entity(instance["entity_id"]) return user_service.check_project_access(entity["project_id"])
def delete(self, scene_id, shot_id): scene = shots_service.get_scene(scene_id) user_service.check_project_access(scene["project_id"]) shot = shots_service.get_shot(shot_id) scenes_service.remove_shot_from_scene(scene, shot) return "", 204
def post(self, task_id, comment_id): task = tasks_service.get_task(task_id) user_service.check_project_access(task["project_id"]) user_service.check_entity_access(task["entity_id"]) return comments_service.acknowledge_comment(comment_id)
def post(self, asset_instance_id, temporal_entity_id): args = self.get_arguments() try: revision = int(args["revision"]) try: working_file = files_service.get_working_file( args["working_file_id"]) working_file_id = working_file["id"] except WorkingFileNotFoundException: working_file_id = None asset_instance = assets_service.get_asset_instance( asset_instance_id) temporal_entity = entities_service.get_entity(temporal_entity_id) entity = assets_service.get_asset(asset_instance["asset_id"]) user_service.check_project_access(entity["project_id"]) output_type = files_service.get_output_type(args["output_type_id"]) task_type = tasks_service.get_task_type(args["task_type_id"]) if args["person_id"] is None: person = persons_service.get_current_user() else: person = persons_service.get_person(args["person_id"]) output_file = files_service.create_new_output_revision( asset_instance["asset_id"], working_file_id, output_type["id"], person["id"], task_type["id"], asset_instance_id=asset_instance["id"], temporal_entity_id=temporal_entity_id, revision=revision, name=args["name"], representation=args["representation"], comment=args["comment"], nb_elements=int(args["nb_elements"]), extension=args["extension"], ) output_file_dict = self.add_path_info( output_file, "output", asset_instance, temporal_entity, output_type, task_type=task_type, name=args["name"], extension=args["extension"], representation=args["representation"], nb_elements=int(args["nb_elements"]), separator=args["sep"], ) except OutputTypeNotFoundException: return {"message": "Cannot find given output type."}, 400 except PersonNotFoundException: return {"message": "Cannot find given person."}, 400 except EntryAlreadyExistsException: return {"message": "The given output file already exists."}, 400 return output_file_dict, 201
def get(self, entity_id): entity = entities_service.get_entity(entity_id) user_service.check_project_access(entity["project_id"]) return files_service.get_output_types_for_entity(entity_id)
def check_update_permissions(self, instance, data): working_file = files_service.get_working_file(instance["id"]) task = tasks_service.get_task(working_file["task_id"]) user_service.check_project_access(task["project_id"])
def get(self, project_id): """ Retrieve all asset types for given project. """ user_service.check_project_access(project_id) return assets_service.get_asset_types_for_project(project_id)
def get(self, project_id, playlist_id): user_service.check_project_access(project_id) return playlists_service.get_playlist_with_preview_file_revisions( playlist_id )
def get(self, project_id): user_service.check_project_access(project_id) return tasks_service.get_time_spents_for_project(project_id)
def get(self, project_id): user_service.check_project_access(project_id) return playlists_service.all_playlists_for_project(project_id)
def get(self, project_id, episode_id): user_service.check_project_access(project_id) shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode(episode_id)
def put(self, entity_id, preview_file_id): preview_file = files_service.get_preview_file(preview_file_id) task = tasks_service.get_task(preview_file["task_id"]) user_service.check_project_access(task["project_id"]) return entities_service.update_entity_preview(entity_id, preview_file_id)
def is_allowed(self, project_id): try: user_service.check_project_access(project_id) return True except permissions.PermissionDenied: return False
def check_read_permissions(self, entity): user_service.check_project_access(entity["project_id"])
def get(self, entity_id, task_type_id): entity = entities_service.get_entity(entity_id) user_service.check_project_access(entity["project_id"]) return tasks_service.get_tasks_for_entity_and_task_type( entity_id, task_type_id)
def get(self, project_id): user_service.check_project_access(project_id) return schedule_service.get_milestones_for_project(project_id)
def check_read_permissions(self, instance): working_file = files_service.get_working_file(instance["id"]) task = tasks_service.get_task(working_file["task_id"]) return user_service.check_project_access(task["project_id"])
def get(self, project_id, task_type_id): user_service.check_project_access(project_id) return schedule_service.get_sequences_schedule_items( project_id, task_type_id)
def check_read_permissions(self, task): user_service.check_project_access(task["project_id"])
def get(self, project_id): user_service.check_project_access(project_id) project = projects_service.get_project_raw(project_id) return fields.serialize_value(project.team)
def check_permissions(self, project_id): user_service.check_project_access(project_id)
def get(self, task_id): task = tasks_service.get_task(task_id) user_service.check_project_access(task["project_id"]) return files_service.get_preview_files_for_task(task_id)
def check_access(self, working_file_id): working_file = files_service.get_working_file(working_file_id) task = tasks_service.get_task(working_file["task_id"]) user_service.check_project_access(task["project_id"]) return working_file
def get(self, task_id): task = tasks_service.get_task(task_id) user_service.check_project_access(task["project_id"]) return tasks_service.get_comments(task_id)
def get(self, asset_instance_id, temporal_entity_id): asset_instance = assets_service.get_asset_instance(asset_instance_id) entity = entities_service.get_entity(asset_instance["asset_id"]) user_service.check_project_access(entity["project_id"]) return files_service.get_output_types_for_instance( asset_instance_id, temporal_entity_id)
def delete(self, task_id, comment_id): task = tasks_service.get_task(task_id) user_service.check_project_access(task["project_id"]) deletion_service.remove_comment(comment_id) return '', 204
def get(self, shot_id): shot = shots_service.get_shot(shot_id) user_service.check_project_access(shot["project_id"]) user_service.check_entity_access(shot["id"]) return shots_service.get_shot_versions(shot_id)
def put(self, task_id): task = tasks_service.get_task(task_id) user_service.check_project_access(task["project_id"]) return tasks_service.start_task(task["id"])
def get(self, project_id, descriptor_id): user_service.check_project_access(project_id) return projects_service.get_metadata_descriptor(descriptor_id)
def check_read_permissions(self, project): user_service.check_project_access(project["id"])