Click here to Skip to main content
15,892,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an Role type page in which i can create roles and a gridview which contains 6 columns such as ID,Pages,Add,View,Edit,Delete column.Pages contains different aspx page names that i have in my application. Add, View,Edit,Delete columns contains the checkboxes. I have a database for permission which also contains 6 columns that are present in the gridview. When i am checked the checkboxes Y is stored in the databases and those are unchecked N is stored. My question is i am not able to associate or map the different roles i have created with this permissions. the roles i have created also stored in a database role with three columns, such as ID, Role_Name and Description. I am new in.net. please help me to do this
Posted
Comments
Dinesh.V.Kumar 25-Mar-14 3:36am    
What are the columns in the Permission table?
Add a column Role_ID in the Permission Table. Make this as Foreign Key.Now you will have a role to permission mapping. In Users table also add a column Role_ID and make it foreign key..You will have a mapping for User-Role-Permission now...With this you can control the permissions for a user...

Hope it helps

Regards
Member 10578683 25-Mar-14 3:50am    
permission table has 6 columns. ID,Pages,Add,View,Edit,Delete etc. I am trying like that u said. thanks.
Dinesh.V.Kumar 25-Mar-14 4:40am    
Try it out..let me know if there is any problem...


Regards
Member 10578683 25-Mar-14 5:22am    
hi i made foreign key but how will i map provide permissions to the roles
Dinesh.V.Kumar 25-Mar-14 5:37am    
While inserting into permissions..insert the role id along with the permission details...it will be mapped...

Regards

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900