Steven,
Yes, you will need to use some code, but not that much.
You basically do what you have to do. However, your original question
was about what to do when you change the names of the roles, which is what
most of my responses have been referring to.
Basically, you get the roles, and can check what to return based on
those roles. However, the framework will handle the assigning of the roles
for you (in ASP.NET configuration roles), so you shouldn't have to worry
about that part.
What you ^could^ do is have your functions that return data marked with
the PrincipalPermission attribute. You can specify the roles that are
allowed to access the function, and if someone tries to access the function
and is not in the role, then a SecurityException will be thrown.
This would require you to split your functions out into more intricate
groups, but would make security easy.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Steven Blair" <st**********@btinternet.com> wrote in message
news:OW*************@TK2MSFTNGP09.phx.gbl...
Maybe I am missing soemthing here.
I want to avoid re-inventing the wheel. Ideally, I want to use the
inbuilt security features completely.
My application allows different users varied access on my app, which is
great. But, the problem is, if "Role1" logs in, I need to filter some
data being returned. If "Role" logs in, same again, some filter on the
data.
Is this possible using only the inbuilt security features, or do I have
to add some C# code to cater for problems like this?
My feeling is that code is required on top of the Roles for my
particular problem, and if thats the case, was looking for suggestions
on how to make this as easy as possible.
Thanks again for the help.
Regards,
Steven
*** Sent via Developersdex http://www.developersdex.com ***