Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I need to define security levels in my program.
Just like windows asks admin privilege when we try to install a software.
It's a mechanism of checking privilege before executing a task.
I need to know is, how I can implement this approach in my java program.
A friend of mine who is a PHP developer told me that, In their web apps
they control users activities by giving permissions to run something called actions.
According to him they have implement some db tables which contains all actions & actions have mapped to some groups. those groups add to users according to privileges that user need to grant.
after that if a admin user logs in he will see everything. but if a standard user logs in he won't be able to see any admin pages.
Since PHP has actions, they could do this.
In JAVA, how can I achieve this approach?
Please advise.

Only thing I need to know is how to do this.

Please remember that I'm very new to JAVA & Programming world.
Posted

1 solution

You coul bind privileges to program functions. For instance, all users could perform very basic functions, like, say, checking details of their profile while only privileged users could take advantage of more critical functions like, say, delete some data.
 
Share this answer
 
Comments
Nipuna S Perera 15-Sep-14 9:01am    
Yes yes. that's what I need. could you please explain me how can I do this. I mean, how to store this privileges(I mean store in DB or something else, and must all functions be added on this DB). how to apply. in this case. If I need to hide or disable any menu that is not related to particular user. how can I do this. I mean, show or visible admin forms or buttons only for admin users,and not to others. like that. I need little code samples to understand, because I'm not much familiar with professional programming terms.
thanks for the understanding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900