diff --git a/app/api/potree.py b/app/api/potree.py index b48dfbe2..2a1f7162 100644 --- a/app/api/potree.py +++ b/app/api/potree.py @@ -16,8 +16,10 @@ class Scene(TaskNestedView): """ Store potree scene information (except camera view) """ - get_and_check_project(request, project_pk, perms=("change_project", )) task = self.get_and_check_task(request, pk) + print(task, task.public, task.public_edit) + if (not task.public) or (task.public and not task.public_edit): + get_and_check_project(request, project_pk, perms=("change_project", )) scene = request.data # Quick type check @@ -36,8 +38,9 @@ class CameraView(TaskNestedView): """ Store camera view information """ - get_and_check_project(request, project_pk, perms=("change_project", )) task = self.get_and_check_task(request, pk) + if (not task.public) or (task.public and not task.public_edit): + get_and_check_project(request, project_pk, perms=("change_project", )) view = request.data if not view: diff --git a/app/models/task.py b/app/models/task.py index 8cab4e35..43ecf3fa 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -1027,6 +1027,7 @@ class Task(models.Model): 'project': self.project.id, 'available_assets': self.available_assets, 'public': self.public, + 'public_edit': self.public_edit, 'epsg': self.epsg } diff --git a/app/static/app/js/components/SharePopup.jsx b/app/static/app/js/components/SharePopup.jsx index e60aec7f..118fb598 100644 --- a/app/static/app/js/components/SharePopup.jsx +++ b/app/static/app/js/components/SharePopup.jsx @@ -121,7 +121,6 @@ class SharePopup extends React.Component{ const shareLink = Utils.absoluteUrl(this.getRelShareLink()); const iframeUrl = Utils.absoluteUrl(`public/task/${this.state.task.id}/iframe/${this.props.linksTarget}/${Utils.toSearchQuery(this.props.queryParams)}`); const iframeCode = ``; - console.log(this.state.task); return (