File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes admin console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "admin console" Watch "admin console" New topic
Author

admin console

monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38

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: 42950
    
  70
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?
Babu Naresh
Greenhorn

Joined: Apr 26, 2010
Posts: 5
Hi Monis,

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
monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38

no jst have an emp id and login acces column consisting of manager level ,employee level and admin level
monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38

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
monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38

Babu Naresh wrote:Hi Monis,

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: 42950
    
  70
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?
monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38

Ulf Dittmer wrote:
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: 42950
    
  70
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.
 
wood burning stoves
 
subject: admin console