K
Kevin
Let me preface this by saying I'm new to Java and I'm maintaining a
program
someone else wrote.
In this system everyone has read access by default. I'm explicitly
granting
permission to those who need modification rights. In this instance,
that
means looking at every save/edit/update/delete button and wrapping it
with
some code to check the user group in the LDAP database.
I only have five different groups right now, and the temptation is to
write
a method that contains a bunch of else if statements to check every
possible
combination of groups (i.e., if user 1 or user 2, do a, else if user 1
or
user 3 do b, etc.). There is absolutely nothing elegant about this
method
and it just doesn't feel right.
Would you mind giving me a recommendation on a better way? I've seen
concepts like JAAS (I've done a little homework), but I'm looking for a
*recommendation* on a best
practice, preferably one that doesn't take a week to implement. Any
help
you could give would be appreciated.
-Kevin
program
someone else wrote.
In this system everyone has read access by default. I'm explicitly
granting
permission to those who need modification rights. In this instance,
that
means looking at every save/edit/update/delete button and wrapping it
with
some code to check the user group in the LDAP database.
I only have five different groups right now, and the temptation is to
write
a method that contains a bunch of else if statements to check every
possible
combination of groups (i.e., if user 1 or user 2, do a, else if user 1
or
user 3 do b, etc.). There is absolutely nothing elegant about this
method
and it just doesn't feel right.
Would you mind giving me a recommendation on a better way? I've seen
concepts like JAAS (I've done a little homework), but I'm looking for a
*recommendation* on a best
practice, preferably one that doesn't take a week to implement. Any
help
you could give would be appreciated.
-Kevin