Coding

Laravel Tutorial – ACL (User Roles) – #1 Setup & Intro

  • 00:00:00 hi everyone welcome back to this new
  • 00:00:03 video I read all the comments under my
  • 00:00:07 last playground with you and I'm really
  • 00:00:11 amazed how many great ideas I've read
  • 00:00:13 there
  • 00:00:14 I haven't replied to most of them but I
  • 00:00:17 read it all and that really is the sense
  • 00:00:20 of the serious that you post comments I
  • 00:00:22 read it and I give my very best to will
  • 00:00:25 make videos about this I'm going to
  • 00:00:28 start with one thing that I've read the
  • 00:00:32 most often implementing some kind of
  • 00:00:35 user roles model so like an access
  • 00:00:40 control list ACL where we can have a
  • 00:00:44 middleware or some kind of protection
  • 00:00:46 which SAS this route is only accessible
  • 00:00:48 by let's say administrators whereas this
  • 00:00:51 route is accessible by everyone and so
  • 00:00:54 on so that's exactly what I'm going to
  • 00:00:56 do in this video or probably depending
  • 00:00:59 on time the next few videos here I will
  • 00:01:02 implement such an ACL such an X control
  • 00:01:06 list we're not actually starting from
  • 00:01:08 scratch I have a simple application here
  • 00:01:11 which has free routes here which are
  • 00:01:12 accessible even though we're not locked
  • 00:01:14 in however I still can log in and I have
  • 00:01:18 free users set up for this a normal user
  • 00:01:23 an admin and an offer however at the
  • 00:01:27 moment all these users are equal because
  • 00:01:29 no rules have been implemented that what
  • 00:01:31 we're going to do in this video however
  • 00:01:33 I can log in the login functionality is
  • 00:01:36 fully implemented as you can see I now
  • 00:01:39 get to logout but here so I am actually
  • 00:01:41 logged in and I can still access all the
  • 00:01:44 routes I Clint click on generate here
  • 00:01:46 which doesn't actually do anything but
  • 00:01:47 says hey article generated great so this
  • 00:01:52 is the app we're working with and what I
  • 00:01:55 want to do is as I said I have a user
  • 00:01:57 and offer and an admin user and I want
  • 00:02:01 the admin deal to be the only one who
  • 00:02:04 may access this admin panel here and
  • 00:02:08 well later once we have implemented
  • 00:02:11 rolls to the free users I created these
  • 00:02:15 are the free users I have as a seed in
  • 00:02:17 this project I also want you offer and
  • 00:02:22 the admin to be able to access this
  • 00:02:25 offer out however the offer should be
  • 00:02:27 the only one who is able to click this
  • 00:02:29 link and actually generate a new article
  • 00:02:32 all users including the normal user
  • 00:02:36 who's never an admin Lauren offer may
  • 00:02:39 access this main page here so that is
  • 00:02:42 what I want to achieve
  • 00:02:44 now the code with which I'm going to
  • 00:02:47 start which creates this application
  • 00:02:49 will be available in a github repository
  • 00:02:52 to which you will find a link in the
  • 00:02:54 description of course so this is the
  • 00:02:57 actual project I'm starting with as you
  • 00:02:59 can see I already guessed get some fuse
  • 00:03:02 here these are the views we just saw in
  • 00:03:06 the application I get a migration from
  • 00:03:09 file the users migration file which just
  • 00:03:12 creates users with the first last name
  • 00:03:14 email address which is unique and
  • 00:03:17 password and I should get rid of this
  • 00:03:21 we're going to create this together and
  • 00:03:22 I also got this user table seeder here
  • 00:03:27 which creates my free well users I start
  • 00:03:31 off with so that is where we started and
  • 00:03:36 in well the next part we'll have a look
  • 00:03:39 at how we start implementing our roles
  • 00:03:43 functionality
  • 00:03:45 see you there bye