Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

admin console

 
monis raza
Ranch Hand
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no jst have an emp id and login acces column consisting of manager level ,employee level and admin level
 
monis raza
Ranch Hand
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic