Click here to Skip to main content
15,923,164 members
Home / Discussions / C#
   

C#

 
GeneralSQL question Pin
Rassul Yunussov10-Jul-05 22:34
Rassul Yunussov10-Jul-05 22:34 
GeneralRe: SQL question Pin
Guffa11-Jul-05 4:51
Guffa11-Jul-05 4:51 
GeneralComponent Control for Windows CE Pin
hung le quoc10-Jul-05 21:29
hung le quoc10-Jul-05 21:29 
GeneralSQL query help Pin
Anonymous10-Jul-05 19:26
Anonymous10-Jul-05 19:26 
GeneralRe: SQL query help Pin
Sheo Narayan10-Jul-05 19:54
Sheo Narayan10-Jul-05 19:54 
GeneralRe: SQL query help Pin
Anonymous10-Jul-05 22:14
Anonymous10-Jul-05 22:14 
GeneralRe: SQL query help Pin
Sheo Narayan10-Jul-05 22:21
Sheo Narayan10-Jul-05 22:21 
QuestionAre Enum's best for this?? Pin
rmoen10-Jul-05 17:49
rmoen10-Jul-05 17:49 
Here's the situation:

I’m building an application that is going to be used buy a ton of different people in my organization. So security is becoming a big deal. Someone in this department can do this function X, but a different department can’t do that function X and so forth. This application is going to grow and evolve. I’m trying to figure out the best way to keep track of who can do what, and ensuring that people are only doing the things they are allowed to do.

Right now I’ve got something like this CurrentUser.IsMemberOf(“Administration”) The IsMemberOf method checks to see if the user is in the supplied group. Only problem is that if Administration ever gets renamed or a developer misspells it, then the compiler won’t ever catch it and the application will have a runtime error.

I was thinking that if I created enums for all of the various functions like
CreateUser
EditUser
EditGroup
EditDocument
ChangeDocumentState
Etc, etc.

Then I could ensure that everything was correct at compile time, and as my application grows I can just add in additional values for the enum.

Then I would do something like
bool result = CurrentUser.CanPreformFunction(Functions.EditUser) ;

Is this a good way to design application functional security? Or is there a better more elegant way?

I don’t think Method Security will work in my case either, because I need to modify the UI depending on the user’s rights, not what they can call, etc.

Let me know!

Thanks!
Ryan



AnswerRe: Are Enum's best for this?? Pin
Guffa11-Jul-05 4:54
Guffa11-Jul-05 4:54 
Questionhow to load a non .Net Win32 DLL in .Net emulator Pin
kroller10-Jul-05 16:42
kroller10-Jul-05 16:42 
AnswerRe: how to load a non .Net Win32 DLL in .Net emulator Pin
Alex Korchemniy10-Jul-05 19:11
Alex Korchemniy10-Jul-05 19:11 
GeneralRe: how to load a non .Net Win32 DLL in .Net emulator Pin
kroller10-Jul-05 19:17
kroller10-Jul-05 19:17 
GeneralReading the contents of a txt/CSV file into an array Pin
TheBlindWatchmaker10-Jul-05 16:15
TheBlindWatchmaker10-Jul-05 16:15 
GeneralRe: Reading the contents of a txt/CSV file into an array Pin
Weiye Chen10-Jul-05 16:44
Weiye Chen10-Jul-05 16:44 
GeneralRe: Reading the contents of a txt/CSV file into an array Pin
Alomgir Miah11-Jul-05 8:33
Alomgir Miah11-Jul-05 8:33 
GeneralAquaButton - A very nice Button control Pin
Nicvan_us10-Jul-05 16:09
Nicvan_us10-Jul-05 16:09 
GeneralRe: AquaButton - A very nice Button control Pin
Alex Korchemniy10-Jul-05 19:08
Alex Korchemniy10-Jul-05 19:08 
GeneralRe: AquaButton - A very nice Button control Pin
User 209307310-Jul-05 19:29
User 209307310-Jul-05 19:29 
Generalmy mp3 alarm clock program Pin
marazm110-Jul-05 14:55
marazm110-Jul-05 14:55 
GeneralRe: my mp3 alarm clock program Pin
Yulianto.10-Jul-05 21:48
Yulianto.10-Jul-05 21:48 
GeneralMass Coding Pin
Expert Coming10-Jul-05 13:45
Expert Coming10-Jul-05 13:45 
GeneralRe: Mass Coding Pin
Guffa10-Jul-05 13:53
Guffa10-Jul-05 13:53 
GeneralRe: Mass Coding Pin
Expert Coming10-Jul-05 13:58
Expert Coming10-Jul-05 13:58 
GeneralRe: Mass Coding Pin
Guffa11-Jul-05 0:44
Guffa11-Jul-05 0:44 
GeneralDifferent Guffa Pin
Expert Coming11-Jul-05 7:39
Expert Coming11-Jul-05 7:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.