I would like to create a view controller that renders the path view



So I have this website I am working on that has a simple data management like the one shown in this link: http://grails.asia/grails-example-application-simple-document-management-system/

I have 3 accounts.

           An admin account, that uploads file into a table

               A user1 account, that can see specific files in a table

               A user2 account, that can see different files in that table
When the admin account uploads those files in a table, He can specify to which path he is uploading them, to user1 or user2

If he uploads them to user1, only user 1 will be able to see them however if he uploads them to user2, only user 2 will be able to see them

How do we create such a controller, that changes the view of the path depending on the password entered.

Can you please direct me to what libraries to read or what functions to use ?