SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
ROLES AND PERMISSIONS BASED
AUTHORIZATION FOR FRONTEND APP
WITH @IMPELSYSINC/REACT-RBAC
...by Abhisek Pattnaik, CE Services
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
1. Pre-requisites
2. Authorization
3. Existing Authorization in Frontend Apps
4. Introduction to React RBAC
5. Permissions
6. Usage
7. Available API
8. Custom Component
9. Demo
10. Relevant Resources
11. The End
Agenda
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
I'm an expert.
Please don't
try to teach
me.
Don't say to
me "You Don't
Know JS" and
Kend C. Dodds
can help you.
Basic understanding about
• Javascript (optionally Typescript) and
• ReactJS
Prerequisites
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
• Authorization is the method of specifying access
rights/privileges to resources.
• Resource is defined as the entity viz. a component, a
page, menu, etc. that is output in the application.
• Action is defined as the type of operation (e.g. VIEW, GET,
UPDATE, DELETE) that the user want to perform on the
given resource.
Authorization
Existing Authorization in Apps
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
• Hard-coded roles
checking.
• Cluttered if statements for
each role.
Existing Authorization in Frontend Apps
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
• Hard-coded permissions checking.
• Lacks granular control.
• Lacks standardization.
• Difficult to extend.
• Lacks flexibility.
Existing Authorization in Frontend Apps
Introducing React RBAC
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
React-RBAC
React RBAC is an open-source library with
which you get more granular control of
resources and actions and has easy to use API
for defining the permissions and controlling
the visibility of the application components.
React RBAC
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
React-RBAC
• Make permissions JSON for any role.
• Statically define in Frontend or Dynamically fetch from
Backend.
The Permissions
React-RBAC Usage in Front-end
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
• Import and use the useRBAC
hook to get the rbac context
value.
• Pass the rbac context value to the
imported RBACProvider.
Where do we fetch or
define the permissions for
the React RBAC library?
The App Component
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
The Layout Component
• You may fetch or define your permissions in a wrapper layout component.
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
React-RBAC
Available APIs
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
React-RBAC
Custom Permission Component
https://to.absk.im/react-rbac-demo
Demo
Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved.
React RBAC
• Repository: https://github.com/ImpelsysInc/react-rbac
• NPM: https://npm.im/@impelsysinc/react-rbac
• Blog Article: https://to.absk.im/react-rbac-article
Relevant Resources
QUESTIONS?
React out via
abhisek.pattnaik@impelsys.com
https://about.me/abhisekp

Weitere ähnliche Inhalte

Ähnlich wie React RBAC - Skill Expresso - Nov 2022.pdf

Extending Enterprise Applications to mobile interfaces-Final
Extending Enterprise Applications to mobile interfaces-FinalExtending Enterprise Applications to mobile interfaces-Final
Extending Enterprise Applications to mobile interfaces-Final
Rohit Dhamija
 
Ranjeet Mishra_JAVA_3+year exp
Ranjeet Mishra_JAVA_3+year expRanjeet Mishra_JAVA_3+year exp
Ranjeet Mishra_JAVA_3+year exp
Ranjeet Mishra
 

Ähnlich wie React RBAC - Skill Expresso - Nov 2022.pdf (20)

API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 
Oracle mcs overview 1029
Oracle mcs overview 1029Oracle mcs overview 1029
Oracle mcs overview 1029
 
Real-World RESTful Service Development Problems and Solutions
Real-World RESTful Service Development Problems and SolutionsReal-World RESTful Service Development Problems and Solutions
Real-World RESTful Service Development Problems and Solutions
 
API Design – More than just a Payload Definition
API Design – More than just a Payload DefinitionAPI Design – More than just a Payload Definition
API Design – More than just a Payload Definition
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptx
 
What is Server-side Rendering? How to Render Your React App on the Server-sid...
What is Server-side Rendering? How to Render Your React App on the Server-sid...What is Server-side Rendering? How to Render Your React App on the Server-sid...
What is Server-side Rendering? How to Render Your React App on the Server-sid...
 
Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!
 
Getting Started with API Management – Why It's Needed On-prem and in the Cloud
Getting Started with API Management – Why It's Needed On-prem and in the CloudGetting Started with API Management – Why It's Needed On-prem and in the Cloud
Getting Started with API Management – Why It's Needed On-prem and in the Cloud
 
Everything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive GuideEverything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive Guide
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
Challenge to Implementing "Scalable" Authorization with Keycloak
Challenge to Implementing "Scalable" Authorization with KeycloakChallenge to Implementing "Scalable" Authorization with Keycloak
Challenge to Implementing "Scalable" Authorization with Keycloak
 
Amandeep kumar final resume (1)
Amandeep kumar final resume (1)Amandeep kumar final resume (1)
Amandeep kumar final resume (1)
 
oracle-apac-developers-meetup-2-building-api-with-apiary-slides
oracle-apac-developers-meetup-2-building-api-with-apiary-slidesoracle-apac-developers-meetup-2-building-api-with-apiary-slides
oracle-apac-developers-meetup-2-building-api-with-apiary-slides
 
Api design and prototype
Api design and prototypeApi design and prototype
Api design and prototype
 
reactjs interview questions.pdf
reactjs interview questions.pdfreactjs interview questions.pdf
reactjs interview questions.pdf
 
Best React Developer Tools to Increase Your Productivity.pdf
Best React Developer Tools to Increase Your Productivity.pdfBest React Developer Tools to Increase Your Productivity.pdf
Best React Developer Tools to Increase Your Productivity.pdf
 
Best Practices for API Design to Keep Your App Secure, Scalable & Efficient
Best Practices for API Design to Keep Your App Secure, Scalable & EfficientBest Practices for API Design to Keep Your App Secure, Scalable & Efficient
Best Practices for API Design to Keep Your App Secure, Scalable & Efficient
 
Extending Enterprise Applications to mobile interfaces-Final
Extending Enterprise Applications to mobile interfaces-FinalExtending Enterprise Applications to mobile interfaces-Final
Extending Enterprise Applications to mobile interfaces-Final
 
Ranjeet Mishra_JAVA_3+year exp
Ranjeet Mishra_JAVA_3+year expRanjeet Mishra_JAVA_3+year exp
Ranjeet Mishra_JAVA_3+year exp
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best Practices
 

Kürzlich hochgeladen

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Kürzlich hochgeladen (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

React RBAC - Skill Expresso - Nov 2022.pdf

  • 1. ROLES AND PERMISSIONS BASED AUTHORIZATION FOR FRONTEND APP WITH @IMPELSYSINC/REACT-RBAC ...by Abhisek Pattnaik, CE Services
  • 2. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. 1. Pre-requisites 2. Authorization 3. Existing Authorization in Frontend Apps 4. Introduction to React RBAC 5. Permissions 6. Usage 7. Available API 8. Custom Component 9. Demo 10. Relevant Resources 11. The End Agenda
  • 3. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. I'm an expert. Please don't try to teach me. Don't say to me "You Don't Know JS" and Kend C. Dodds can help you. Basic understanding about • Javascript (optionally Typescript) and • ReactJS Prerequisites
  • 4. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. • Authorization is the method of specifying access rights/privileges to resources. • Resource is defined as the entity viz. a component, a page, menu, etc. that is output in the application. • Action is defined as the type of operation (e.g. VIEW, GET, UPDATE, DELETE) that the user want to perform on the given resource. Authorization
  • 6. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. • Hard-coded roles checking. • Cluttered if statements for each role. Existing Authorization in Frontend Apps
  • 7. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. • Hard-coded permissions checking. • Lacks granular control. • Lacks standardization. • Difficult to extend. • Lacks flexibility. Existing Authorization in Frontend Apps
  • 9. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. React-RBAC React RBAC is an open-source library with which you get more granular control of resources and actions and has easy to use API for defining the permissions and controlling the visibility of the application components. React RBAC
  • 10. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. React-RBAC • Make permissions JSON for any role. • Statically define in Frontend or Dynamically fetch from Backend. The Permissions
  • 11. React-RBAC Usage in Front-end
  • 12. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. • Import and use the useRBAC hook to get the rbac context value. • Pass the rbac context value to the imported RBACProvider. Where do we fetch or define the permissions for the React RBAC library? The App Component
  • 13. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. The Layout Component • You may fetch or define your permissions in a wrapper layout component.
  • 14. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. React-RBAC Available APIs
  • 15. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. React-RBAC Custom Permission Component
  • 17. Copyright © 2022 : (HeartBangalore) Impelsys Inc.All Rights Reserved. React RBAC • Repository: https://github.com/ImpelsysInc/react-rbac • NPM: https://npm.im/@impelsysinc/react-rbac • Blog Article: https://to.absk.im/react-rbac-article Relevant Resources