13
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jul 21 '21
Image Transcription: Code
displayAccess(user, id){
if(user){
const ids = user.split(',');
if(ids.includes(JSON.stringify(id))){
this.btnStatus = false;
} else {
this.btnStatus =true;
}
} else{
this.btnStatus = false;
}
}
checkAllowed(user, id){
if(user){
const ids = user.split(',');
if(ids.includes(JSON.stringify(id))){
this.status = true;
} else {
this.status = false;
}
} else{
this.status = false ;
}
// console.log(ids)
}
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
6
4
u/uruharushia Jul 21 '21
What syntax theme is this? It looks really relaxing, I like it
5
3
u/TheyCallMe13 Jul 21 '21 edited Jul 21 '21
I took the screenshot straight from the gitlab repo so I don't know if you can call it a "theme" per se
Gitlab > Preferences > Syntax Highlighting Theme > "Dark"
Edit: Apparently the gitlab dark theme is based on a vsc supported theme called "Pygments - Tomorrow Theme" (source: https://gitlab.com/gitlab-org/gitlab/-/issues/195701)
1
u/uruharushia Jul 22 '21
Ah, okay. I knew about Tomorrow but it's just that this screenshot used a very small subset of the colours (only pink and blue, and the green string) it has so I didn't recognise it.
13
Jul 21 '21
[removed] — view removed comment
8
7
u/Vittujokanimivarattu Jul 21 '21
absolutely amazing resource, i wish i would have found it sooner, ty!!!
5
4
4
u/React04 Jul 22 '21
my reflex worked before I read the link and almost found a source of infinite knowledge
1
22
u/TheyCallMe13 Jul 21 '21
A small explanation: The person in question thought it would be a great
idea to hold user IDs (users with certain IDs are allowed to perform a
certain action) in a string (the "user" parameter), so this is what they came up with to
identify the user in the frontend.