Assign user roles to view, upload and update material

Very good afteroon, is my first entry to this platform and despite the many setbacks I have managed to survive the multiple blows. But what I have already is another level. . .

t turns out that we are implementing a computer system to upload files from various dependencies, but our interest is that information is organized by the different roles that a user may have. There will be 5 levels: level 0 is for guest and is forbidden at all, level 1 will only be for human resources people, and so on. Level 4 will be for the presidency and vice presidency people and will be able to see all the files.

Since the databases of the files and the users have the roles organized, but I still don’t know how to make the user, when entering, add the option of their role, and only the files of that role are shown, and can update only your files…

And also that is another doubt, liekly is a simple thing, but I don’t see it: that when entering the site does not show the index of ‘Congratulations!’ and so, but it is in the directory of the project created.

Conceivably to be in SiteController, but I don’t know what to change (because the


echo ""

they do not work in the traditional way as if they did with pure PHP)…

Check this : Yii2 RBAC

Also you can use an extension like Yii2-usuario

It your needs aren´t covered by these is probably you need an AccessRule