I want to design an admin console in which i will grant access to sers while ticking on the checkbox against that module and employee.
please can anyone help me how to approach it in servlets . I am getting short of ideas
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
How are you keeping track of users - in a DB table? Then you need a table that keeps track of which user has access to which module, i.e. a combination of userID, moduleID and a boolean. Is that what you're asking?
If I understand your statement correctly, you might think about this approach.
On logging in with the user, you can keep the user value in the session so that you get the entered user through out the session.
From the jsp page where check boxes are available, get the checked (modules)values in to the servlet.
In this way, you have user(employee) and module information in the servlet. From servlet hit DB, create a record.
DB design:
Have Employee, Module tables. Module table should have emp_id as secondary id - corresponding to - emp_id as primary key in Employee table.
For each check box checked value, insert a separate row. Ex., emp 1 should have access to HR and PAYROLL modules. Insert 2 separate rows for module table.
Ulf Dittmer wrote:How are you keeping track of users - in a DB table? Then you need a table that keeps track of which user has access to which module, i.e. a combination of userID, moduleID and a boolean. Is that what you're asking?
no jst have an emp id and login acces column consisting of manager level ,employee level and admin level
If I understand your statement correctly, you might think about this approach.
On logging in with the user, you can keep the user value in the session so that you get the entered user through out the session.
From the jsp page where check boxes are available, get the checked (modules)values in to the servlet.
In this way, you have user(employee) and module information in the servlet. From servlet hit DB, create a record.
DB design:
Have Employee, Module tables. Module table should have emp_id as secondary id - corresponding to - emp_id as primary key in Employee table.
For each check box checked value, insert a separate row. Ex., emp 1 should have access to HR and PAYROLL modules. Insert 2 separate rows for module table.
Thanks,
Naresh
am sure there s much easier way than this
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
monis raza wrote:no jst have an emp id and login acces column consisting of manager level ,employee level and admin level
Well, you will need to keep track somewhere of which user has which access rights, won't you? Or are you thinking of hard-coding into each module which of the 3 levels can access it?
monis raza wrote:no jst have an emp id and login acces column consisting of manager level ,employee level and admin level
Well, you will need to keep track somewhere of which user has which access rights, won't you? Or are you thinking of hard-coding into each module which of the 3 levels can access it?
am sure there s much easier way than this
That being the case, what ideas have you had?
I dont want to hard code, I was thinking of hiding modules with java script in the main page.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
I'm confused. What does JavaScript have to do with user authentication? You can't use it for making decisions about that, because it is amenable to tampering by the user.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.