Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Revoke A User's Login Privilege

Status
Not open for further replies.

TomBarrand

Programmer
Aug 9, 2000
162
0
0
GB
Hi,

I am using LAPI and Java and need to revoke a users login privilege. How do I do this?

I know how to set them but not how to revoke a specific privilege. I presume that you use the UpdateUserInfo method and set attributes.add("UserPrivileges", WHATEVER GOES HERE);

What I am trying to achieve is disable the user account so the user can not login and do anything in Livelink. I do not want to delete the user in Livelink terms because I know that that is quite severe and the account could not be re-enabled at a later date if needs be.

Thanks
 
The user privileges are bitmasked.If you put 14 then all privs including login will be revoked.15 will give it back.Read upon the documentation.I am about to put my full working code at under the LAPI WIKI area in case you want to take alook.You will however need an account
<code>
LAPI_USERS users = null;
// Instantiate UAPI object
users = new LAPI_USERS( session );
LLValue myUserPrivs = ( new LLValue() ).setAssocNotSet();
//myUserPrivs.add("UserPrivileges",14); //IN GUI this is all privs revoked
myUserPrivs.add("UserPrivileges",15); //IN GUI this is login
status= users.UpdateUserInfo("tbarrand",myUserPrivs);
System.out.println("BITWISE of these privs will be ");
System.out.println( users.PRIV_LOGIN |users.PRIV_UAPI_SESSION | users.PRIV_DAPI_SESSION | users.PRIV_WAPI_SESSION);
System.out.println( users.PRIV_UAPI_SESSION | users.PRIV_DAPI_SESSION | users.PRIV_WAPI_SESSION);

</code>

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top