Gii Login form

Hi all

I am really beginner to Yii and Gii so this question may look like straight forward.

I am not sure where I have to put this post. I have generated Model and CRUD with gii and as you know it comes with two username/password pairs namely admin/admin and demo/demo. I have 2 questions:

  1. How can we have more than two username/password pairs with separate task assigned to each. For example, I want to define two other username/password like user1/user1 and user2/user2. I want user 1 to be able to view and add and user2 view/add/delete.

  2. What if I dont want to set usernames and password in UserIdentity.php and instead, want to retrieve from a Database? The simplest table is a table with two columns, User name and password.

Thank you