-
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
Switch to logged_in_as(roles) to simplify auth logic! #5259
Comments
Reposting from part of #268 |
Ack! We actually have this! So this issue could be for switching to this system: plots2/app/helpers/application_helper.rb Lines 3 to 13 in aba49c4
|
This could be broken into many This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself! |
Made #5306 for |
@jywarren I am a ROR developer and I am new to open source. I would like to work on this. |
We will love to have your help
…On Fri, Apr 19, 2019, 4:53 AM Srinandan Pai ***@***.***> wrote:
@jywarren <https://github.com/jywarren> I am a ROR developer and I am new
to open source. I would like to work on this.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#5259 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFAAEQZENCA5DGQDLLAG4LDPRD7H7ANCNFSM4HA6BSOQ>
.
|
the
User
model could use some simpler helpers, which would dramatically simplify some template code for showing things only to moderators or admins, like this:plots2/app/views/users/list.html.erb
Lines 8 to 11 in aba49c4
Instead, let's make a user model method like:
Then that code could become:
But we need to be able to specify if it's AND or OR -- any ideas?
Maybe:
We could also simplify by making an application_helper method like:
where we also check if there is a
current_user
, further simplifying the code!We'd love some help with this, and ideally the new methods would be tested as well! Thanks!
The text was updated successfully, but these errors were encountered: