-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Basic/Normal User not able to delete own wiki page #2013
Comments
Can i take this issue??
…On Jan 16, 2018 3:55 PM, "Sagarpreet Chadha" ***@***.***> wrote:
Hi, this is a first-timers-only
<https://github.com/publiclab/plots2/projects/2> issue. This means we've
worked to make it more legible to folks who either *haven't contributed
to our codebase before, or even folks who haven't contributed to open
source before*.
If that's you, we're interested in helping you take the first step and can
answer questions and help you out as you do. Note that we're especially
interested in contributions from people from groups underrepresented in
free and open source software!
If you have contributed before, consider leaving this one for someone new,
and looking through our general help wanted
<https://github.com/publiclab/plots2/labels/help-wanted> issues. Thanks!
The Problem
When normal/basic user deletes the wiki page created by him/her , the
login screen is shown .
Solution
The delete button on wiki page links to /notes/delete/ .
https://github.com/publiclab/plots2/blob/ac0f56fff35d9a62d7bcc1d0726260
b8d7187a31/app/views/like/_like.html.erb#L52
However the if condition in *notes#delete method* is incorrect here .
We need to change *if* condition in line :
https://github.com/publiclab/plots2/blob/ac0f56fff35d9a62d7bcc1d0726260
b8d7187a31/app/controllers/notes_controller.rb#L237
to :
if current_user && (current_user.uid == @node.uid || current_user.role ==
"moderator" || current_user.role == "admin")
Feel free to ask any doubt regarding the issue ! Thank you ! Steps to Fix
- claim this issue with a comment here, below, and ask any clarifying
questions you need
- set up a repository locally following the README instructions, and
make sure that all tests pass
- try to fix the issue following the steps above, but even before
you're done, you can:
commit your changes and start a pull request (see contributing to
Public Lab software) but mark it as "in progress" if you have questions or
if you haven't finished
- alert someone via the developers list (see below) to have your pull
request merged. This may take a few extra steps depending on when you do
it, but we'll help you out!
Please email the developers list (see https://publiclab.org/wiki/
developers) or go to the chatroom <http://publiclab.org/chat> if you have
questions, and take a look at our first-timers landing page for more
information! <https://github.com/publiclab/plots2/projects/2>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2013>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcUuMka3zZSGUGdYQ0qj18vvApRGLDXlks5tLHkLgaJpZM4RfjDk>
.
|
Hi, I'd like to request one more condition -- if any other authors have contributed to a wiki page, we will need to disable the ability to delete your own page, because you might delete someone else's contributions. So we'll need a check to be sure Can we add this condition to the controller and if it's not met, return a message that Thank you!!! Lines 216 to 218 in 3df8567
|
And yes, @ankitbhardwaj78 if this extra condition seems feasible for you, we'd love to! @sagarpreet-chadha would you be able to help @ankitbhardwaj78 with this extra condition? Thanks! |
Yes @jywarren , i would love to help ! Thanks 😄 . |
I will do this.. @jywarren |
@jywarren and @sagarpreet-chadha please take a review i have made changes #2030 |
Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The Problem
When normal/basic user deletes the wiki page created by him/her , the login screen is shown .
Solution
The delete button on wiki page links to
/notes/delete/
.plots2/app/views/like/_like.html.erb
Line 52 in ac0f56f
However the if condition in notes#delete method is incorrect here .
We need to change if condition in line :
plots2/app/controllers/notes_controller.rb
Line 237 in ac0f56f
to :
if current_user && (current_user.uid == @node.uid || current_user.role == "moderator" || current_user.role == "admin")
Feel free to ask any doubt regarding the issue ! Thank you !
Steps to Fix
commit your changes and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
Please email the developers list (see https://publiclab.org/wiki/developers) or go to the chatroom if you have questions, and take a look at our first-timers landing page for more information!
The text was updated successfully, but these errors were encountered: