-
Notifications
You must be signed in to change notification settings - Fork 305
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
Delete slide button in the Table #303
Conversation
akhil-rana
commented
Apr 3, 2020
$('#deleteModal').modal('toggle'); | ||
$("#confirmDelete").unbind( "click" ); | ||
$("#confirmDelete").click(function(){ | ||
store.deleteSlide(oid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Akhil I have implemented the same but here it returns a promise so, you can check if data.result.ok is 1 then initialize the table.
I think it would be better, if in the Modal we tell the user about the name and id of the slide, which he is going to delete, so that he can make his confirmation to delete, without any doubt. The modal message can be something like : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akhil-rana , It would be nice, if these changes are made.
I have tested it by making these changes locally.
Co-Authored-By: Chirag Jain <[email protected]>
Co-Authored-By: Chirag Jain <[email protected]>
Co-Authored-By: Chirag Jain <[email protected]>
Co-Authored-By: Chirag Jain <[email protected]>
Co-Authored-By: Chirag Jain <[email protected]>
Co-Authored-By: Chirag Jain <[email protected]>
Thanks @cjchirag7 |
@cjchirag7 @mgautam98, I appreciate that you guys work hard for deleting slides. The problem is that you must determine the current user who has the permission to delete the slide or not. It involves authority management. In the current situation, there are two types of users, one is |
@nanli-emory https://github.com/camicroscope/Caracal/blob/master/caracal.js#L62 @birm What are your thoughts? |
Yes, in instances where we are checking attributes, slide deletion should only be performable by Admins and Editors (same people who can add a slide), and, as applicable, have a userFilter matching the slide's filter field (same people who can see the slide). I'm not sure it's foolproof yet, but that should be taken care of by the backend. |
We can do one thing that display the delete icon only, if the user is Editor or admin, so to avoid unnecessary requests to the backend also. |
@cjchirag7 Thanks. This is what I'm talking about. From the UX perspective, we shouldn't show up a |
@nanli-emory |
Or we could send a dummy delete request on page initialisation just to check if the user has permission or not. |
You may notice a function called parseJwt which can get token data, which should include userType and userFilter, matching what's in the user mongo collection. |
@akhil-rana We should get the |
@birm Thanks for the info. |
I will add the function called |
Okay. Great !! |
@akhil-rana I added |
Thank you for your effort. |
@nanli-emory The function will always return Null when we work with develop.yml since we have no security in that case. |
We may need to either add a route which displays some safe-to-show env variables the server has. |
@nanli-emory , the code in util.js is not compiling, after the latest commit.
The travis build is also failing. This is because the word 'return' is misspelled. I have corrected it and fixed some lint issues in PR #310 |
@birm Yes, I was thinking the same thing. |
Sure! I've added an issue matching what I think may be a scalable strategy. |
@birm @nanli-emory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That must've been quite a journey, thank you!
Thank you all for the help and effort. |