Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/fix permission test #1893

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions api/main/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7491,6 +7491,12 @@ def test_crud(self):
rp = RowProtection.objects.get(pk=rp_id)
self.assertEqual(rp.permission, 0)


# Now switch to the commandant and verify there is no permission
self.client.force_authenticate(user=self.commandant)
resp = self.client.get(f"/rest/Medias/{self.project.pk}")
assertResponse(self, resp, status.HTTP_403_FORBIDDEN)

# kirk delete the row protection of engineering
self.client.force_authenticate(user=self.kirk)
resp = self.client.delete(f"/rest/RowProtection/{engi_rp_id}")
Expand All @@ -7499,5 +7505,4 @@ def test_crud(self):
# Now switch to the redshirt and verify they can't see the engineering section
self.client.force_authenticate(user=self.red_shirt)
resp = self.client.get(f"/rest/Medias/{self.project.pk}")
assertResponse(self, resp, status.HTTP_200_OK)
self.assertEqual(len(resp.data), 0)
assertResponse(self, resp, status.HTTP_403_FORBIDDEN)
6 changes: 1 addition & 5 deletions ui/src/js/annotation/annotation-multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,7 @@ export class AnnotationMulti extends TatorElement {

this._videoTimeline.init(0, this._timeStore.getLastGlobalFrame());
this._entityTimeline.init(0, this._timeStore.getLastGlobalFrame());
this._displayTimelineLabels = true;
this._entityTimeline.showFocus(
this._displayTimelineLabels,
this._videos[this._primaryVideoIndex].currentFrame()
);
this._displayTimelineLabels = false;

this._slider.setAttribute("min", 0);
this._slider.setAttribute("max", this._timeStore.getLastGlobalFrame());
Expand Down
6 changes: 1 addition & 5 deletions ui/src/js/annotation/annotation-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -940,11 +940,7 @@ export class AnnotationPlayer extends TatorElement {

this._videoTimeline.init(0, this._timeStore.getLastGlobalFrame());
this._entityTimeline.init(0, this._timeStore.getLastGlobalFrame());
this._displayTimelineLabels = true;
this._entityTimeline.showFocus(
this._displayTimelineLabels,
this._video.currentFrame()
);
this._displayTimelineLabels = false;

this._slider.setAttribute("min", 0);
this._slider.setAttribute("max", this._timeStore.getLastGlobalFrame());
Expand Down
Loading