Sistema de blogs Diarium
Universidad de Salamanca
Pablo Gallardo's Blog
My professional web log about IT, Cybersecurity & Project Management
 

How to check if User is admin from a Java Application

This post is about summarizing different ways to check if user is admin in JAva

 

Use system calls to check if user is admin

A Java application can call system command through the class Runnable

You can see this post about ways to know if from command line.

The code to execute a command from a Java application:

Runtime.getRuntime().exec(command);

You will need to make some adjustments depending on operating system.

 

Use isElevationNeeded from PriviledgeRunner class

Method isElevationNeeded from PriviledgeRunner class in IzPack uses this method.

 

You might also be interested in…

External references

pmgallardo

About pmgallardo

I studied Computer Science at University of Salamanca. Since then, I have been working first as developer and then as SAP consutant. This blog is about problems I dealt when using computers, and more important, the solutions I found. Whenever I am on an issue and suddenlly I have a flash that leads me to a solution, I document my discoveries in a post.

, , , , , , , ,

No comments yet.

Leave a Reply


*

Política de privacidad
Studii Salmantini. Campus de excelencia internacional