How To Handle Permissions Like A Senior Dev

Поделиться
HTML-код
  • Опубликовано: 17 янв 2025

Комментарии • 325

  • @WebDevSimplified
    @WebDevSimplified  2 месяца назад +9

    Try Clerk: go.clerk.com/b2b-orgs

  • @UCoviltwg
    @UCoviltwg 2 месяца назад +202

    I like how over time your channel covers more and more advanced topics. I feel like I've been growing in my career in a similar pace, so you always have me covered! Thank you

    • @xaweeeed33rt5g43wsd
      @xaweeeed33rt5g43wsd 2 месяца назад +12

      you are wrong. What you are doing is consuming precisely targeted ads. This video is nothing more than an advertisement. He didn't even mention free/open source alternatives. Every second of this video is designed to attract you to the clerk's product.

    • @minhaz3193
      @minhaz3193 2 месяца назад +18

      @@xaweeeed33rt5g43wsd the permission logic is the same regardless of what auth provider you use though. You expect to consume his videos for free then complain when he gets someone else to pay him to continue teaching for free.

    • @tfcbhop6380
      @tfcbhop6380 2 месяца назад

      @@xaweeeed33rt5g43wsdso what? The auth process stays the same without clerk and also that’s some great learning material and good explanation he’s done.

    • @theo-k4i8m
      @theo-k4i8m 2 месяца назад

      @Mac501pl Me too 😅

    • @krakntc
      @krakntc Месяц назад

      @@xaweeeed33rt5g43wsd BULLSHIT

  • @man_of_men_
    @man_of_men_ Месяц назад +5

    This has really helped me at work! Thank you!

    • @WebDevSimplified
      @WebDevSimplified  Месяц назад +2

      Thank you so much for the support! I am really glad I could help.

  • @killerpixel2k3
    @killerpixel2k3 2 месяца назад +176

    Great video!!! It's important to note that you have to handle permissions for both the client display AND the database action. For example, if you display the delete button for your own comments and clicking it results in `DELETE /api/comments/123` and someone can find the ID of another comment (maybe by looking at the XHR request for the listing page of comments) and issues their own DELETE fetch request to the other comment, your backend or DB has to also check permissions and not just delete the comment. Postgres can do row-based and column-based policies that makes that a lot easier to do that particular check on the backend.

    • @warrenarnoldmusic
      @warrenarnoldmusic 2 месяца назад +45

      But why would you move authorization logic to the db layer really. A server app layer can handle this comfortably. Unless you share and touch db outside of the app, or are serving client app straight from db eg firebase, i would not advise for that. Db should be kept as simple as possible.

    • @killerpixel2k3
      @killerpixel2k3 2 месяца назад +15

      @warrenarnoldmusic that's why I said either do it on the backend or DB. One over the other and what "should" be done is a preference / philosophical question, making sure a client side request is validated for authorization is not a question, but a requirement.

    • @retakenroots
      @retakenroots 2 месяца назад +6

      ​@@warrenarnoldmusicyou could even consider building a dbase access layer. The server should only use that layer. Any program accessing that dbase should use that access layer. It enables access control to be shared.

    • @codewrangler
      @codewrangler 2 месяца назад +8

      I would recommend a layered approach to authorization. Frontend and backend. Frontend - fetch the role of the user from DB. Then use something like RLS in Postgres to support row-level security. Then write RLS policies for each table that leverages the user roles. In supabase you can do this easily.

    • @fakedoctor7527
      @fakedoctor7527 2 месяца назад +2

      let me made it simpler what this guy says is just do not directly update the db, do check is this from the same user or not

  • @elhaambasheerch7058
    @elhaambasheerch7058 2 месяца назад +84

    26:00 , "I am not really that great at typescript", says the guy who is my and many other self taught coders' favourite teacher.
    Take a bow man.

  • @shakilajaya-b8i
    @shakilajaya-b8i 16 часов назад

    You know well how to explain something to others. Presentation skills and how you organize the script and story examples are very nice. Loved that. Thanks a lot bro

  • @FeelFreeToCode
    @FeelFreeToCode Месяц назад +4

    Fantastic video! The way you broke down handling permissions from a senior dev's perspective was so clear and practical. Definitely a must-watch for anyone serious about scaling their software development practices

  • @jareddiscipio1768
    @jareddiscipio1768 2 месяца назад +9

    Another great tutorial from one of the best content creators on RUclips!!! Keep it up man

  • @Gabifuertes
    @Gabifuertes 2 месяца назад +1

    15:42 This is what I've come up with on my own and have used for quite a bit. It's great to have someone show me the limitations and then how to overcome them. Thank you!

  • @هواتف-م9ر
    @هواتف-م9ر 2 месяца назад +33

    This guy puts out quality educational content and for free !!!
    Thanks man

    • @paeon
      @paeon 2 месяца назад +2

      the problem is free, the solution is a paid service, so...

  • @JohnGasper
    @JohnGasper 2 месяца назад +30

    IAM professional here. Great job showing devs solid principals that can be applied to most projects, Clerk or not.

  • @msahu2595
    @msahu2595 2 месяца назад +2

    Amazing 🤩 I have been searching for years for this video. But never find this kind of your where all kind of permission handling discussed in a single video with all advantages and disadvantages. Thankyou for this video 🥳

  • @Tszyu01
    @Tszyu01 2 месяца назад +40

    CASL is a great library with many integrations for handling complex decisioning like this

    • @zocky3282
      @zocky3282 2 месяца назад +1

      +1 for CASL

    • @023PrashantSharma
      @023PrashantSharma 2 месяца назад

      +1

    • @023PrashantSharma
      @023PrashantSharma 2 месяца назад

      Initial it is hard to me to work with it but now I now how powerful and simple

    • @zul.overflow
      @zul.overflow 2 месяца назад

      casl team 👊

    • @AlexanderMoon
      @AlexanderMoon 2 месяца назад

      I wouldn't be surprised if Clerk uses CASL internally

  • @hernanbphb
    @hernanbphb 2 месяца назад +6

    its been 4 min and I already feel the whole video will be worthwhile

    • @StingSting844
      @StingSting844 2 месяца назад

      It will be worthwhile if you're a beginner

    • @hernanbphb
      @hernanbphb 2 месяца назад +3

      ​@@StingSting844 yeah I dont think seniors are watching videos on youtube on how to do auth, thanks for pointing the obvious

    • @Bistourki
      @Bistourki Месяц назад

      @@hernanbphb of course we are, because you should be always be learning from others to get better. Don't think you know everything perfectly when you suddenly become "senior"

  • @someguyO2W
    @someguyO2W 2 месяца назад +12

    This is possibly one of the best resources hands down, on the topic.
    You did a great job!

  • @WhispersatDusk-dy9hy
    @WhispersatDusk-dy9hy 2 месяца назад +12

    As someone who works on a permissions team, glad to see some coverage about it. Not talked about much but is crucial to get right. And try not to roll your own authorization unless your companies unique demands call for it.

    • @MartinnAvramov
      @MartinnAvramov 8 дней назад

      Could you explain why it is not a good idea to roll your own authorization? Are you talking about small or big projects?

  • @juniordev4life
    @juniordev4life 2 месяца назад +2

    Thanks! Great tip. I'm still working on a 20 year old application and rewrite it from scratch. I will use this advice. Top tip! Go forward with more of these practical topics.

  • @TheStallion1319
    @TheStallion1319 2 месяца назад +8

    more in this topic please , people usually skip this part and use ready solution, but building it up from scratch and understanding this topics is what differentiates a good dev from the others

  • @deucebigs9860
    @deucebigs9860 2 месяца назад +1

    What perfect timing for me that you put this video out. Thanks!

  • @karsh001
    @karsh001 2 месяца назад +2

    Lovely vid! First implementation is generally called CRUD, Create Read Update Delete. It's generally better to keep to the standard. The standar for all this called NIST INCITS 359-2012. My personal fav product for ABAC is called Axiomatics. Easy to work with both as dev and admin.
    The whole point of ABAC from an enterprise view is to place the complexity where it belongs - at the business level. A chief enterprise architect may at any time be responsible for several dev projects. Dealing with different authorization models for every system becomes needlessly complex for every one. From this perspective, devs with ABAC skills become very valuable.

  • @avinashsharma5450
    @avinashsharma5450 Месяц назад

    have been looking for this topic for days now
    Loved the way you simplified the context.

  • @opasanhandle
    @opasanhandle Месяц назад

    This is an excellent topic for a video, even for experienced software engineers. The explanations are truly great. Well done!

  • @benny-shen
    @benny-shen Месяц назад

    I have been waiting for this topic for long, thanks man

  • @Joey-o7p
    @Joey-o7p 2 месяца назад +6

    I love senior dev contents ~

  • @saifuddinsaifee1635
    @saifuddinsaifee1635 Месяц назад

    This is some high quality content! We need more content like this!

  • @dreamsachiever212
    @dreamsachiever212 2 месяца назад +2

    loving these content lately. thanks.keep cooking

  • @ziacodes
    @ziacodes 2 месяца назад +9

    Please do this more often, This is something I would learn everyday.

  • @dadamssg87
    @dadamssg87 9 дней назад +1

    I enjoyed the video. Thanks! This seems like a fraction of the solution though. I'd love to see this expanded on from a backend perspective. For example, fetching collections of resources to view. You wouldn't fetch them all and then run them through the `hasPermission` function to filter them down. You would want to do that in database query.

  • @ClarkeDesign
    @ClarkeDesign 2 месяца назад +1

    I've just written a system using CodeIgniter and implemented security using Shield - which is there Role Based Access Control system. Very good and made like so much easier as things changed during development. Using if statements like "can a use do this" made development and security so much easier.

  • @rijumamdq
    @rijumamdq 2 месяца назад

    Great video and I love the last approach. Thanks for the tutorial and for all the quality knowledge you share on the channel.

  • @maurosoto9910
    @maurosoto9910 Месяц назад

    I followed this practice and I loved this, is highly reliable if the permissions are changing

  • @fadhilinjagi1090
    @fadhilinjagi1090 2 месяца назад +2

    I like Bouncer authorization system from Adonis. It's the most straightforward one I have ever seen

  • @justinhoward6384
    @justinhoward6384 2 месяца назад +1

    This is awesome because you helped me get a job, and now you're helping me keep it!

  • @sathishkannan6600
    @sathishkannan6600 2 месяца назад +2

    This is some good stuff. I was facing a similar problem in work. Thank you.

  • @learn-with-khaalid
    @learn-with-khaalid 2 месяца назад +1

    Wow, Thanks Web Dev Simplified Very Helpful please Continue Making Videos For advanced Topics

  • @cherubin7th
    @cherubin7th 2 месяца назад +8

    This came just in time!

    • @Bayzon08
      @Bayzon08 2 месяца назад

      I was going to implement security on my api today, this was a god sent

  • @nikolaykolev5143
    @nikolaykolev5143 19 дней назад

    Really nice content. Thank you for sharing all this. I've implemented the ABAC approach in a couple of projects of mine, before even knowing that the approach I came up with alone has a name..ahaha. I love how granular it is and how it simplifies all the checks. Another cool thing about it, that I think you didn't mention, is that you, as a developer, don't need to remember all the roles' permissions. I've done some RBAC systems over the years and I found out that when I come back to some of them, I constantly have to refer to the roles model so that I can remember what to check for. With ABAC is way simpler cause, even if you go back to a project after some time, you read the checks and you immediately understand what they are for..instead of a check about if user is "admin" or "moderator", and then having to go back to that "admin" and "moderator" roles' specs to remember what they can or can't actually do. I don't use Clerk cause I've already implemented a similar approach doing all the tables on my own..but I'll check it out for sure! Thanks again. Great content! Not very often spoken about, by the way!

  • @omarbitar2414
    @omarbitar2414 2 месяца назад +1

    Loving the best practice videos you've been pushing lately. Can u make a video on which architectural design patterns to use for reactive frameworks like vue and react? Like mvc and mvvm?

  • @mrsvilkic
    @mrsvilkic 2 месяца назад +2

    Thank you so much! I was just implementing RBAC on a huge project today, but Im going to change it to ABAC!

  • @frikkie
    @frikkie 2 месяца назад +5

    Using Bitmasking makes it even easier. That also solves the problem of permission inheritance from various roles - that way you only end up with one permission set per user, don't have to work with roles directly.

    • @milimilutinovic835
      @milimilutinovic835 2 месяца назад +1

      Could you please elaborate on this interesting suggestion

    • @frikkie
      @frikkie 2 месяца назад

      ​@@milimilutinovic835 A bit difficult to explain in a comment, but let's try.
      Think of bits as permission flags. For instance, let’s say we have four permissions: Create, Read, Update, and Delete (C, R, U, D). These can be represented in binary as 1111, which equals 15 in decimal. A bit for each permission.
      If a user has all four permissions, you store the value 15 next to their name.
      To check if a user has a particular permission, you can use bitwise operations. Assign a unique decimal value to each permission:
      {
      create: 1,
      read: 2,
      update: 4,
      delete: 8
      }
      Now, to check if a user has the "update" permission, simply do:
      userPermissions & systemPerms.update
      This operation returns a non-zero value if the user has the "update" permission (since bitwise AND compares corresponding bits and returns a match if both are set).
      To avoid running out of bit values, group permissions into categories:
      {
      homepage: { seeBanner: 1, clickButton: 2 },
      users: { create: 1, update: 2, read: 4, delete: 8, allocate: 16 }
      }
      Now you can store decimal values for each category:
      {
      homepage: 1,
      users: 31
      }
      When a user has multiple roles, you combine their permissions by adding the respective role values together.
      Bitwise operations allow you to modify permissions:
      Add permission:
      userPerms.users |= systemperms.users.delete; // Adds the 'delete' permission
      Toggle permission:
      userPerms.users ^= systemperms.users.delete; // Toggles the 'delete' permission
      Remove permission:
      userPerms.users &= ~systemperms.users.delete; // Removes the 'delete' permission
      Summary of operators:
      |= (OR assignment): Adds the specified bit to userPerms.users. If it’s already set, no change occurs.
      ^= (XOR assignment): Toggles the specified bit in userPerms.users.
      &= ~ (AND with negation): Removes the specified bit from userPerms.users.
      This approach efficiently manages permissions and scales well for larger applications with many roles and permissions.

    • @frikkie
      @frikkie 2 месяца назад

      ​@@milimilutinovic835 Think of bits as permission flags. For instance, let’s say we have four permissions: Create, Read, Update, and Delete (C, R, U, D). These can be represented in binary as 1111, which equals 15 in decimal.
      If a user has all four permissions, you store the value 15 next to their name.
      To check if a user has a particular permission, you can use bitwise operations. Assign a unique decimal value to each permission:
      {
      create: 1,
      read: 2,
      update: 4,
      delete: 8
      }
      Now, to check if a user has the "update" permission, simply do:
      userPermissions & systemPerms.update
      This operation returns a non-zero value if the user has the "update" permission (since bitwise AND compares corresponding bits and returns a match if both are set).
      To avoid running out of bit values, group permissions into categories:
      {
      homepage: { seeBanner: 1, clickButton: 2 },
      users: { create: 1, update: 2, read: 4, delete: 8, allocate: 16 }
      }
      Now you can store decimal values for each category:
      {
      homepage: 1,
      users: 31
      }
      When a user has multiple roles, you combine their permissions by adding the respective role values together.
      Bitwise operations allow you to modify permissions:
      Add permission:
      userPerms.users |= systemperms.users.delete; // Adds the 'delete' permission
      Toggle permission:
      userPerms.users ^= systemperms.users.delete; // Toggles the 'delete' permission
      Remove permission:
      userPerms.users &= ~systemperms.users.delete; // Removes the 'delete' permission
      Summary of operators:
      |= (OR assignment): Adds the specified bit to userPerms.users. If it’s already set, no change occurs.
      ^= (XOR assignment): Toggles the specified bit in userPerms.users.
      &= ~ (AND with negation): Removes the specified bit from userPerms.users.
      This approach efficiently manages permissions and scales well for larger applications with many roles and permissions.

    • @XiangWeiHuang
      @XiangWeiHuang 2 месяца назад

      ​@@milimilutinovic835 consider a website with only one page, and the permission system controls who can read that page. We can write the permission data as a bit, if they can read it's 1; if they can't it's 0.
      Now this page got CRUD, 4 functions. Similar idea, we can have 4 bits to say this user can create but not others (1000); this user can read and update but not create nor delete (0110).
      By this way, instead of designating what role can do what, we can "stack" the roles easily. If a user has two roles: 1000 and 0110, then depends on your design, either he has privilege of 1110 or 0000, they can both be easily calculated thanks to bit masking.
      In C# this is abstracted(?) into Flags, in wrongly simplified way it's like enum but supports OR. if (UserRole.Admin | UserRole.Peasant), etc.
      Much simpler than bunches of booleans, as once frontend and backend promised upon one same chart of flags (i.e. which bit is needed for user to read this page), the value can be passed as simple numbers and then go on with the logics even more easier.

    • @jbeaudoin11
      @jbeaudoin11 Месяц назад

      ​@@milimilutinovic835 i know you commented out 2 weeks ago but if you still wanna know, basically you don't need to store a string for each perm you have. You can encode them via bitmask. Say you have CRUD operations, 0 means not allowed, 1 means allowed. Admin role gets 1111 (15 in base 10, all perms), a user gets 0100 (4 in base 10, read only). If you need read and update your check is 0110, you can validate if a user has the required perm bits via binary operations like & (and).
      Anyways.. it's just a different way to encode the same information. It can get tricky real quick if you want to extend your system outside rbac and crud. As always, might still be a good solution for your context.

  • @franklinsecretario3862
    @franklinsecretario3862 2 месяца назад

    Looking forward to more content like this! Great video, by the way-very informative.

  • @andrevinsky
    @andrevinsky 2 месяца назад

    Thanks Kyle! The video is phenomenal! So professional, great work!

  • @T1Oracle
    @T1Oracle 2 месяца назад +5

    User -> Action -> Resource
    User = Id
    Action = CRUD
    Resource = Type, Id
    Role = Action + Resource
    Roles are a simplification.

  • @ManasMadrecha
    @ManasMadrecha 2 месяца назад +1

    Thanks. Could you add a video on how to store the roles & permissions (especially the Functions for the resource itself) inside Database?

    • @WebDevSimplified
      @WebDevSimplified  2 месяца назад

      I don't plan on expanding this to storing in a DB. If you wanted to store this in a DB you would need to not use functions and instead store your data in a form like JSON which you could then use to do checks with. For example you could store something like { authorId: "eq({userId}" } in JSON to signify the authorId must equal the current user's id.

    • @ManasMadrecha
      @ManasMadrecha 2 месяца назад

      @WebDevSimplified yes, I like this approach. That can work. Thanks for this informative video 😊

    • @daviddomkar
      @daviddomkar 2 месяца назад +1

      Take a look at CEL expressions. You could store code in the form of these expressions in the database and then evaluate them when the actual permission check happens.

    • @ibrarmunir1894
      @ibrarmunir1894 6 часов назад

      @@daviddomkar Any example in nodejs and typescript?

  • @yurisich
    @yurisich 2 месяца назад

    This is a good example of using exhaustive type systems to remove stringly-typed APIs. Very useful.

    • @T1Oracle
      @T1Oracle 2 месяца назад

      Imagine how much better it would be in Rust! 😉

  • @Kirides
    @Kirides Месяц назад

    we have a multi tenant (no resource sharing) permission system, which has it's fair share of issues.
    Like, a single client (application) has more than 500 "permissions", user-defined roles, composite group/role inheritance.
    The hardest thing with permissions is - how to scale and not completely lock up the services.
    Like, let users only see documents for which they have permissions, based on their tenant.
    Of couse, they need functioning pagination and per-user filtering on the data.
    maintaining this, making sure queries only include what the user is allowed to see, etc. is the hard part.
    Just having user management is easy in our case.

  • @royz_1
    @royz_1 2 месяца назад +19

    Beware clerk users!! public metadata in clerk is limited to 8KB which isn't enough for even a medium sized production application. We implemented ABAC (attribute based access control) using clerk's public metadata last year and we hit the ceiling a couple of months ago. Clerk is so buggy that instead of not letting you store data which exceeds the limit, it would put the client in an endless refresh loop. A pretty terrible oversight.

    • @KWerder92
      @KWerder92 2 месяца назад

      Just curious, what data did you put in there? I mean 8kB is huge isnt it? I guess not only stuff related to ABAC?

    • @royz_1
      @royz_1 2 месяца назад +1

      @@KWerder92 mainly an array of features and routes. 8kb is not that much when storing JSON.

    • @PureDizzi
      @PureDizzi 2 месяца назад +9

      Real devs make their own clerk

    • @victor95pc
      @victor95pc Месяц назад +5

      @@PureDizzi Obvious: Why pay and risk your product to a third-party company when you can use an open-source library to manage it?
      Clerk only works for pet projects and junior devs

  • @Imk_Aslam
    @Imk_Aslam 2 месяца назад

    Quality content appreciates your efforts man.

  • @limavfabio
    @limavfabio Месяц назад

    Great video, really helpful even to me as a Rails developer

  • @maciekwar
    @maciekwar 2 месяца назад +1

    typescript is such a blessing :) this is pretty nice, but this has one assumption, when you say what roles user has, you are giving positive authorization for a user, this is allow authorization, there is also negative case, deny authorization, that takes precedence over allow, and if you have multiple roles, you can setup in a way that if you have role hierarchy that is not additive, meaning each lower role is not a subset of higher role, then deny will be handy, you can add authorization to a user, for a role this is usually allow, but also for a permission, this can deny something, this way you can do role_level1 role_level2 role_level3, and level2 can do everything that level1 and something else, but level3 can include level2, and level1 and something else, but also exclude something that only level1 and level2 can do. its not my invention, some businesses work this way.

  • @DarrylHebbes
    @DarrylHebbes 2 месяца назад +2

    Love the masterclass episodes!

    • @WebDevSimplified
      @WebDevSimplified  2 месяца назад +2

      Thanks. I have really enjoyed making them!

  • @inducingchaos
    @inducingchaos Месяц назад

    This is insane value, thank you

  • @degan1919
    @degan1919 Месяц назад

    Just implemented permissions for the first time a few months ago. Saw this video on my feed and was like, "Am I really a senior dev?". Sure enough, I just naturally built the permissions with roles system because I saw the issues with just roles themselves.

  • @MubosherMuydinov-f7p
    @MubosherMuydinov-f7p Месяц назад

    great comperhansive guide for permissions thanks bro

  • @summergua6123
    @summergua6123 Месяц назад

    This video really helps! Thank you.

  • @grim.reaper
    @grim.reaper 2 месяца назад +3

    😭😭😭😭 thank you so much for making this

  • @antidegenerates7449
    @antidegenerates7449 2 месяца назад

    Best dev content on RUclips

  • @kousseilameniche6246
    @kousseilameniche6246 2 месяца назад

    Exactly when i needed it! thanks goat

  • @jeremybuckets
    @jeremybuckets Месяц назад +1

    FWIW - If you're watching this video, you're probably working on a system that has at most two roles: I'm a user and I can take any action on my own date, or I'm an admin and I can take any action on most or all data. For that type of system, role-based authentication is surprisingly powerful. Don't introduce a bunch of complexity that you don't need because it seems more flexible in theory. You'll know when you need something more complex when you feel the problems of your current implementation. Don't try to anticipate them ahead of time unless you've done this a lot already (in which case you're probably not learning from this video.)

  • @bboydarknesz
    @bboydarknesz Месяц назад

    bro slowly crack my head :"D
    but this is the best way of teaching, start for simple to very complex.

  • @tuannguyenanh7466
    @tuannguyenanh7466 25 дней назад

    I am using Casbin just fine. Thanks for a great video btw.

  • @josevelez6865
    @josevelez6865 Месяц назад

    Amazing! Thank you so much for this content!

  • @williamokano
    @williamokano Месяц назад

    Very cool and very detailed post. Loved the subject about ABAC and how to achieve some level like Google docs. One small thing tho, Google uses ReBAC for docs, not ABAC, using a proprietary implementation of their paper for Project Zanzibar.
    Still, absolutely awesome video

  • @ADITYACHEBROLU
    @ADITYACHEBROLU 2 месяца назад

    Great content! Need more videos like these❤

  • @supremeoverlord1
    @supremeoverlord1 2 месяца назад +1

    Heya Kyle 😎. Love your contents man

  • @matthias5317
    @matthias5317 2 месяца назад +1

    Great Video and imho a really very clean solution regarding permission management. Thanks
    I have some concerns with Clerk. Maybe you could address them in a future video - it feels weird to store the most personal data with a 3rd party - and there are obvious GDPR concerns. Also what happens if clerk decides to shut down. - I know you have a paid cooperation with them - but could you do a video on those topics from a developer perspective. Maybe there are solutions for those issues. Working in the EU - with larger organisations, that share those concerns - it would be good to have answers from a developers perspective.

    • @LetrixAR
      @LetrixAR 2 месяца назад

      You only store username, email (for login, password reset) and, in this case, roles. You rarely need to give a 3rd party auth service more data than that.

  • @arztv1422
    @arztv1422 2 месяца назад

    Hi Kyle,
    Love your content! One minor suggestion: could you make the code editor and browser output colors consistent (both black or white) in your future videos? The current contrast makes it hard to watch.

  • @MrVipulLal
    @MrVipulLal 2 месяца назад

    Thanks! Really good video.

  • @tonyg_nerd
    @tonyg_nerd 2 месяца назад

    Another great vid Kyle. Always tough to see your stuff on phone with small font but usually fine to zoom the device for detail. Please try to minimize size of less relevant visual artifacts, perhaps including your face. 😂

  • @aliakbarafridi3374
    @aliakbarafridi3374 23 дня назад

    Very informative ❤

  • @baileysli6235
    @baileysli6235 2 месяца назад

    3:55 change arrays into set. It's require more memory, but I'll check these permissions very often, so it's better avoid extra iterations

    • @theodorealenas3171
      @theodorealenas3171 2 месяца назад

      I think it's about 3000 elements where it starts to be faster to get the from a hashmap. Below 3000 elements itsfaater to iterate through an array and check each element. In some contexts it's 3000, in others 10000

  • @bluegam3r_975
    @bluegam3r_975 2 месяца назад

    I was just about to implement this. Nice

  • @code-env
    @code-env 2 месяца назад

    The video was really nice!
    can you make a video on how to use the clerk webhook directly?

  • @sunnydsx9531
    @sunnydsx9531 28 дней назад +1

    Is that you, Jody?

  • @abbasebadian6851
    @abbasebadian6851 2 месяца назад +84

    Too much head movement on the x axis.

    • @DracoCorvus
      @DracoCorvus Месяц назад +3

      I only see that now 😔😂

    • @blind020
      @blind020 29 дней назад +1

      🤣

    • @danielugbeye
      @danielugbeye 25 дней назад +2

      I can’t unsee that now😂

    • @stapia505
      @stapia505 21 день назад +4

      The more you code the more Indian you become

    • @BoxingSwe
      @BoxingSwe 19 дней назад +2

      😂😂😂

  • @danieladinugroho673
    @danieladinugroho673 2 месяца назад +1

    Hi Kyle, thank you for this tutorial. I learn a lot from your tuts and saving to enroll on your course. Just wondering, why you choose to use {actions:resource} but not the other way around? I am thinking {resource:action} would be more readable and we can group them easily. We can have {resource:*} as well to allow all actions on the resource.

    • @WebDevSimplified
      @WebDevSimplified  2 месяца назад +1

      Either works. I find that it reads more like English to say create:thing than to say thing:create

  • @wisdomdakoh4472
    @wisdomdakoh4472 Месяц назад

    Great video sir !!!, but i would love to ask if you could do one that explains RBAC on the backend with NodeJS

  • @sebastianjulonchamana2987
    @sebastianjulonchamana2987 2 месяца назад

    this is gold, thanks!!!!

  • @droogielamer
    @droogielamer 2 месяца назад

    You should also support "scope", so that users can delegate part of their permissions to third party (at least if you provide an API or something similar).

  • @miervaldis42
    @miervaldis42 2 месяца назад

    Can you make a playlist with all of your "Like A Senior Dev" videos please ?

  • @Greedygoblingames
    @Greedygoblingames 2 месяца назад +1

    Sage advice. SAP has been doing it this way for decades

  • @alirezamohammadi9691
    @alirezamohammadi9691 2 месяца назад +1

    bro youtube is missing your zustand crash course please consider it for your next video

  • @0.amonymous
    @0.amonymous 2 месяца назад +28

    I feel like clerk overcomplicates everything here, seems much easier to just create the permission checking function ourselves (btw I just found CASL it seems really simple to use and it's free). I think this channel is great, but this video specifically is WebDevOverEngineered. And clickbait. I clicked expecting to see best practices on Permissions and how to structure them, instead I got baited lol. Didn't really go into depth on how to structure it yourself.
    Clerk is a third party with data limits. Also this video is clickbait. It's a sponsor. It's a clerk review. Total click bait. It's not a video focused on permissions, it's about Clerk... Also I totally missed where he said it's a sponsor. I know he said it, but I didn't see/notice him saying it.

    • @abdarker1043
      @abdarker1043 2 месяца назад +4

      plus who uses a 3rd party for this? this is suitable for school projects

    • @0.amonymous
      @0.amonymous 2 месяца назад +3

      @abdarker1043 I swear the clerk implementation details he described makes no sense to me. Why the hell would I do all that. Why use a lib that just checks keys inside User/Roles from a database, and has some obscure implementation steps and functions. Simple DB Relations with tables:Users/Companys/Roles/Perms already do all that.

    • @theodorealenas3171
      @theodorealenas3171 2 месяца назад +2

      I was sure he was about to raw dog the implementation so I was confused he talked about Clerk.
      Btw does that UI with the JSON have to do with Clerk? If so, that's a plus

  • @nitay2870
    @nitay2870 2 месяца назад

    Thank you so much for everything, can you please continue also with more video with javascript :)

  • @GuildOfCalamity
    @GuildOfCalamity 2 месяца назад

    Great video, but can you cover what extensions you have running in VS?

  • @rajufelix3070
    @rajufelix3070 Месяц назад

    Fantastic Video!!

  • @jupeto
    @jupeto Месяц назад

    A few more videos with those head movements, and I wouldn’t be surprised if your accent starts changing too. 😂
    Still, I love the way you explain things!

  • @harshitpant07
    @harshitpant07 2 месяца назад +6

    need masterclass on how to set hair like you

  • @utkarshseth3082
    @utkarshseth3082 2 месяца назад

    This is really good one i watched full video 🔥🔥🔥🔥

  • @thatsalot3577
    @thatsalot3577 2 месяца назад

    you taught me to do permissions like that 0:01 few years ago 😆

  • @inmosh
    @inmosh 8 дней назад

    Cool video. Could not help but notice that Django has this exact system built in. I wonder if we lost something in JS world.

  • @KishanOza-q3f
    @KishanOza-q3f 2 месяца назад

    Thanks Great video!! we wanted to use clerk as well but the problem with that is we started our project with manual role based auth. we are using trpc, prisma and zenstack. If you can make a video around these stack with clerk that would be very helpful.

  • @icantchosemyname
    @icantchosemyname Месяц назад

    It resembles laravel model policies. Thanks for sharing

  • @AdityaRaj-lj5wf
    @AdityaRaj-lj5wf 2 месяца назад +2

    Hey Kyle, there's an extension of vs code that hides .env values for recording purposes.
    Hope it helps

    • @WebDevSimplified
      @WebDevSimplified  2 месяца назад +1

      Thanks for letting me know, but I have no issues showing my .env file since I always delete my keys after recording a video.

  • @AmirLatypov
    @AmirLatypov 2 месяца назад

    Incredible work! A few days ago I looked for existing libraries for this type of permissions, but all of them were complicated and not so easy to use.
    Do you want to make an npm package?

  • @dgdev69
    @dgdev69 2 месяца назад

    Bro never fails to deliver.
    Would love to see oauth, jwt token for viewing images.

  • @Invisible_Joy
    @Invisible_Joy 2 месяца назад

    Very helpful 👍🏻

  • @hussainbhagat8855
    @hussainbhagat8855 3 дня назад

    Please create a project based on this where you are using the ABAC system based on roles.

  • @sgtrice1
    @sgtrice1 Месяц назад

    Great video, just one question, What do we do if we have more than two sections. It seems like the roles object will be massive. Or a bunch of roles.

  • @VectorNodes
    @VectorNodes 2 месяца назад

    I remember before understanding access control I accidentally over engineered my way up to inventing a terrible abac. It wouldn’t surprise me at all if that site is still using most of my newbie code haha