<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/role-based-access-in-react-3nejpmvyz" -->

---
title: Role-based access in React | daily.dev
description: The React app is a simple React app for a company with three distinct roles. We’ll be implementing a role-based access system in a React app using...
canonical: https://daily.dev/posts/role-based-access-in-react-3nejpmvyz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Role-based access in React | daily.dev
og:description: The React app is a simple React app for a company with three distinct roles. We’ll be implementing a role-based access system in a React app using...
og:url: https://daily.dev/posts/role-based-access-in-react-3nejpmvyz
og:image: https://api.daily.dev/og/posts/3NEJPMvYZ.png
og:image:alt: Role-based access in React
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Role-based access in React

**[asayer](https://daily.dev/sources/asayer)** · 9 min read · 51 upvotes · 2 comments

## Summary

The React app is a simple React app for a company with three distinct roles. We’ll be implementing a role-based access system in a React app using react-router-dom protected routes. Only a marketer will be able to access the software engineering route, and only the human resource personnel will have access to the marketing route.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.openreplay.com/role-based-access-in-react/>

## Community discussion

Top comments from developers on daily.dev.

**@tugrulyildirim** · 0 upvotes

> Thanks for sharing bro !

**@frankgg** · 0 upvotes

> Any well known packages for react to handle permission/roles for access control?

---

Tags: [#react](https://daily.dev/tags/react), [#database](https://daily.dev/tags/database), [#react-router](https://daily.dev/tags/react-router)

[View this post on daily.dev](https://daily.dev/posts/role-based-access-in-react-3nejpmvyz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Role-based access in React","url":"https://daily.dev/posts/role-based-access-in-react-3nejpmvyz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/role-based-access-in-react-3nejpmvyz"},"datePublished":"2022-11-08T23:32:17.730Z","dateModified":"2022-11-08T23:32:17.728Z","description":"The React app is a simple React app for a company with three distinct roles. We’ll be implementing a role-based access system in a React app using...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b86b8cb7af60db7f235dfc871e878d26","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b86b8cb7af60db7f235dfc871e878d26","isAccessibleForFree":true,"articleSection":"asayer","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"asayer","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/be8d9d38650943c8a1718ba79f23e9ac","url":"https://daily.dev/sources/asayer"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/role-based-access-in-react-3nejpmvyz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":51},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"react,database,react-router","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"asayer","item":"https://daily.dev/sources/asayer"},{"@type":"ListItem","position":3,"name":"Role-based access in React"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/role-based-access-in-react-3nejpmvyz","comment":[{"@type":"Comment","text":"Thanks for sharing bro !","datePublished":"2022-11-10T07:30:20.133Z","url":"https://daily.dev/posts/3NEJPMvYZ#c-syIcSlkQF","author":{"@type":"Person","name":"tugrulyildirim.com","url":"https://daily.dev/tugrulyildirim","image":"https://avatars1.githubusercontent.com/u/58388980?v=4"}},{"@type":"Comment","text":"Any well known packages for react to handle permission/roles for access control?","datePublished":"2022-11-10T15:20:56.642Z","url":"https://daily.dev/posts/3NEJPMvYZ#c-21o4wb02n","author":{"@type":"Person","name":"Frank Glynne Grobbelaar","url":"https://daily.dev/frankgg","image":"https://lh3.googleusercontent.com/a/ALm5wu2N7-iBLNeYM-oWVJYe-NZzSMnoQ2SlDdc2xCm2uw=s96-c"}}]}
```

