views:

209

answers:

2

how Ican use declarative security("[PrincipalPermissionAttribute(SecurityAction.Demand, Role = "")]) but I don't want to check role I need to check the permissions for that role? scince I have roles and permissions for each role how I can use declarative security for permissions?

Thanks for help

A: 

Roles don't have Permissions in asp.net ... they ARE the permissions.

Page.User.IsInRole("FileUploader") Page.User.IsInRole("Administrator")

http://msdn.microsoft.com/en-us/library/5k850zwb.aspx

Chad Grant
if I have database that contain roles table and permissions table what I can do to check the permissions for user role?
Chad Grant
A: 

If you want to tie your Roles along with your Permissions table, you'll probably want to write your own class. I haven't read this link, but see if the following walkthrough helps at all ...

EDIT: Or, you could store the Permissions values within each user's Profile, whether it be with one of the default providers or one you've developed yourself.

bryan_cook