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

Access control #2

Open
Blacoffee opened this issue Mar 19, 2020 · 3 comments
Open

Access control #2

Blacoffee opened this issue Mar 19, 2020 · 3 comments

Comments

@Blacoffee
Copy link

Hello Jaewon,
I wanted to say that i really appreciate your work man, i am working on an e-commerce project for school and your tutorial was very helpful. Thank you very much

Otherwise i need your help, what should i do if i want only the admin to upload new products ? I am kind of new to Full Stack Development and this is my first real world project. I want to hide the upload menu for normal users. I get a lot of errors every time I try to change something in the code.

Can you please help me ?
Also i hope you and your family are well, please stay at home and take care ;)

@KevinLu
Copy link

KevinLu commented May 7, 2020

You can set role to 1 for your admin user and add a third parameter to Auth in your App.js and set that parameter to true.

<Route exact path="/product/upload" component={Auth(UploadProductPage, true, true)} />

@ahsankaleem
Copy link

Hi Sir, It says failed to fetch data

@TurboJapuraEfac
Copy link

Hello Jaewon,
I wanted to say that i really appreciate your work man, i am working on an e-commerce project for school and your tutorial was very helpful. Thank you very much

Otherwise i need your help, what should i do if i want only the admin to upload new products ? I am kind of new to Full Stack Development and this is my first real world project. I want to hide the upload menu for normal users. I get a lot of errors every time I try to change something in the code.

Can you please help me ?
Also i hope you and your family are well, please stay at home and take care ;)

There is a good course in Coursera called Full stack development with react you can check that. You have to authenticate the user whether he is a admin or not before accessing backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants