Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually many times I create code
For permission assessment for role

Like
Admin role have permission like add user view user delete user

If you select add user then by default view user permission added in your list
Add if you remove view user then all releted add delete edit permission will gone from list
Some times both approval permission and verifier permission cant assign to single role this type of checking


For different roles many permission near about 30 are there

I added hell lot of if else conditions

If this add this etc looking very bad


So I am searching for easy way to do this
Posted
Updated 2-Nov-14 6:48am
v3
Comments
CHill60 2-Nov-14 12:43pm    
Try posting the code that you think looks very bad
BillWoodruff 2-Nov-14 13:28pm    
Are you saying you are looking for an alternative way to express resolving a complex set of conditions without writing very complex if-then-else nested code, or complex nested switch-case statements ?

As CHill60 asked, it would be good to see a sample of your code.
Sinisa Hajnal 3-Nov-14 4:40am    
You could also write the code once (however bad it looks) and use it in base page or some separate class whose methods you will call in your controllers...

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