logo

NJP

#Part2 Creating List Layouts, Access Controls, View Rules

Import · May 04, 2020 · video

we are going to create our list layout click on create application file look for list layout and then look for student request table and then click on create great so this is our default list here so we can do some configuration here removed some of the fields that we have here in the selected list and then we can save this one as our default view so from this default bit we can create our new view this is going to be our student you and make sure that it set the view name the student if you want to make any changes to your student view so I'm gonna do it here the conflict status and also the requested for fields feel and then save this one this is going to be my student okay similarly I'm going to create another view is going to be my teacher view and then just delete the conflict status field I'm gonna save that one done so we have done with our list views and so let's create just I'm sorry let's add some rows to our application me lingos I'm going to add here is the teacher role and I'm going to just modify the title of my student request module so I'm gonna put here introduction and then add teacher role so what people can access student and teacher can access application lingua and introduction okay so now let's I would like to bring your focus on one thing here the student request table ok as you can see here in the user role level here we have the student role which means only student can access this table for example the teacher who has a teacher role cannot access this to student request table so what we have to do in this case is to add teacher role on the access control level so we do have four different access control create create edit and right so we're gonna add on that level ok the first thing that we have to do when it comes to working with the access control is to elevate your role to security and mean ok that's what I'm going to do right now so I'm going to elevate the role to security enemy and then I'm good I will be able to make any changes to my act control so let's see who will be able to create on the student request so only students should be able to create here right so I'm gonna see here I already have the student rules I'm not going to add any more role so we will be able to read both people should be able to read so I'm going to add here the teacher role and who will be able to delete I'm going to give access to only to the teacher so I'm going to delete the student role here and then add the teacher okay and who will be able to write both people should be able to write on this table so I'm gonna add the teacher role additionally to the role that I have already here the student roles great so we have done with our roles access control and so on now let's create our view rule so the view rule is basically going to define what kind of application view we should have based on certain condition okay so we're gonna create that one so let's give it a name here student request view rule and make sure on the table section that we have the right table student request table here and click on advanced so if we have here our default function override view and we're gonna write a small script so which is going to first test a certain condition and then apply a view the condition here we're going to just first get the currently logged in user with the method get user and then we're gonna check with the method as role what is if that user has a specific role or not so if if we have if that specific user as a student role we're gonna apply the student view that we have any answer variable okay we are going to do exactly the same thing just write another condition which is going to test if that if any specific if the logged in user as a teacher role if yes we're gonna apply the teacher view which I have in the answer variable great so let's see now let's let's test let's see if any teacher or student have the proper view on our so I'm going to add some rows so I'm gonna pick one user a leash is going to be our student she will have the teacher sorry teacher sorry student role here so I'm gonna select here's to enroll save that one I'm gonna add also to Allison she's going to be our teacher here so I'm gonna add here the teacher role great done so let's see if Ally our students she will be able to create a record or not or she will be able able to see the introduction module great she's able to see the interaction module I'm gonna create a new record just for testing okay great so I'm gonna pick a random date here submit a groupie I'm able to create a record here great so let's see if our teacher she will be able to see this specific ox I'm gonna type here linguae great I have introduction I'm gonna see yes great Alyson our teacher she's able to see the record and let's see if she she will be able to delete this record great as well she can delete this record okay we have pretty much done for this video but we are going to do in our upcoming videos we're gonna create two more tables and working with access control thanks for watching hope you like it bye

View original source

https://www.youtube.com/watch?v=S4T7cxbMxLk