Overview
Now that we started a Project in Wayfast, we can set different Menu and Sub-Menu items and assign the pages associated to them. Apart from that, we will learn how to associate menu items to a certain Role. This features allows to configure Application’s Role Based Access Control (RBAC) for each user who logins and work on the Project.
Menu Items
Preconditions
First, we need to create a Project and build the structure with database before set a requirement as active.
How to create new Menu items?
Under the Project top menu, click on “General Options” icon. Then click on “Menu” subtab
“Menu” dashboard displays all the Menu items and Roles that currently are created for this Project.
We will focus on “Custom Roles” functionality in another lesson.
Let’s create a new menu in few steps! First click on “Add items” button.
A popup “Create a new menu item” is displayed with the mandatory information.
A menu needs to be associated to any page, otherwise, it will be empty and won’t redirect to any place in the application. There’s an option to associate the menu item to a new page by clicking “New Page” button.
Field Name | Description |
---|---|
Description of Items | Name of the menu item |
Select the Destination | Displays all the pages associated to the Project. According to the selection, menu item will redirect to the page. |
Parameters | |
Order | Displays the place of the menu item in the page depending on how many menu items are created in the Project |
Type | Displays the way that the menu item is opened. It can be on the same page or a popup. |
Visibility condition | |
Style | Displays the style related to the menu item |
Selecting the popup type, Wayfast will show the position where we are going to place the popup in the page every time that this is prompted.
We can set the “Order” field to place this menu item in the page depending on how many menu items are created. In the example, we are going to create the first menu item in Project.
Once we set all the required field, click on “Accept” button and we can observe the new menu item under the dashboard. If we want to edit the menu item, we need to click on the “Menu’s name” link.
Next to the menu item created, we can see a “Cross” red icon under the “Delete” column to remove the object from dashboard.
Another thing that we can do to verify the menu item creation is access to the Project site using the Preview functionality. We need to keep in mind that changes will be immediately impacted, make sure to clean the cache in browser if the menu is not visible.
How to add Roles and Permissions on Menu items?
Now that we have the menu item created and displayed in the Project, we can verify that the Role associated to the object is ADMIN.
Let’s focus on Roles section and click on “Quantity Items” column, a popup is displayed on the screen with all the menu items listed (this popup is similar to the Menu dashboard) with every destination page and conditions/parameters that we established including the order in the Project.
What happens if we don’t need that every user see all the menu items and pages related? On this lesson, we will learn how to create new roles. Let’s click on “Add Roles” button under the Menu dashboard.
Again, we need to put a role’s description (Name) and the destination’s page for that new role. In the example, we can search by the same page previously linked to our “Wayfast Menu” item.
Then click on “Submit” button.
At this point, we have a new Role but we don’t have any assigned users. We can quickly remove our user from Admin role and reassign to “Wayfast New Role” created to verify that the configuration is working as expected. Click on “Quantity Users” link for Admin and then click on “Add User” button
A pop up with our user linked is displayed. Remove the user and click on “Accept” button, now we are able to assign the user into the new role.
Repeat the steps, click on Quantity Users link (related to “New Role”) and click on “Add User” button.
Once the user is registered, we can see it available for “New Role” row.
Now we need to associate the new role to the menu item as final step. For this purpose, click on “Quantity Items” link and a popup will display the related menu items. Click on “Add items” and then assign which menu items should be visible for this role.
Let’s verify now that the role for our user is updated. Return to the Project site and refresh the page (sometimes it will need to clean browser’s cache). We can check that the right assignation is available.
Can Users have Multiple Roles?
Wayfast is supporting only one role per user registered on the Project. If we add a user that is already assigned to a role the app will check any previous assignation and it will display an error message.
Recap
In the first part of this lesson, we learnt about how to create new Menu items and how they can contain Pages previously created. We defined the relationship in General Options. In the second part, we created Roles and understand how they can be assigned to the listed users and menu items. Finally we navigated briefly through the Project site to verify that the new changes are applied on the fly. In next lessons, we can learn how Wayfast allows us the possibility to establish multiple conditions and parameters that make this parent-child logic more complex and accurate to our system’s needs.