#1  
Old 20th August 2012, 03:24 PM
nick nick is offline
Junior Member
 
Join Date: Feb 2012
Posts: 8
Default tnxSecurityMonitor.addUser v3.1004 d7

where has tnxSecurityMonitor.addUser() gone in v3.1004? How do I add a user now?
  #2  
Old 20th August 2012, 04:04 PM
Thorsten Engler [NDA]
 
Posts: n/a
Default Re: tnxSecurityMonitor.addUser v3.1004 d7

nick wrote:

> where has tnxSecurityMonitor.addUser() gone in v3.1004? How do I add a
> user now?


You have to call:

function TnxSecurityMonitor.LogIn(const aUserName : UnicodeString;
const aPassword : UnicodeString)
: InxLoggedInUser31000;

InxLoggedInUser31000 = interface(InxInvokable)
['{6BF2AC76-CB7F-4051-B770-73AF46CA627F}']

function GetUserName : UnicodeString;
function GetIsUser : Boolean;
function GetIsAdmin : Boolean;
function GetHasReadAccess : Boolean;
function GetHasWriteAccess : Boolean;

procedure ChangePassword(aPassword: UnicodeString);

property UserName: UnicodeString
read GetUserName;
property IsUser: Boolean
read GetIsUser;
property IsAdmin: Boolean
read GetIsAdmin;
property HasReadAccess: Boolean
read GetHasReadAccess;
property HasWriteAccess: Boolean
read GetHasWriteAccess;
end;

with a username/password that has admin rights.

There is always a user called Administrator which can not be deleted or
disabled. The default password is NexusDB, but can (and should) be changed.

If the user has admin rights, then an interface cast to
InxLoggedInAdministrator31000 will succeed:

var
LoggedInUser : InxLoggedInUser31000;
LoggedInAdmin : InxLoggedInAdministrator31000
begin
//...
If Supports(LoggedInUser, InxLoggedInAdministrator31000, LoggedInAdmin) then
begin
//...
end;

That interface:

InxLoggedInAdministrator31000 = interface(InxInvokable)
['{D8E30E37-4A36-4979-A7A7-9B3DFB1849C4}']
function UserList: TnxUnicodeStrings;
function AdminList: TnxUnicodeStrings;

function UserExists(const aUserName : UnicodeString)
: Boolean;

procedure AddUser(const aUserName : UnicodeString;
const aPassword : UnicodeString;
aAsAdmin : Boolean;
aReadAccess : Boolean;
aWriteAccess : Boolean);
procedure RemoveUser(const aUserName : UnicodeString);
function ModifyUser(const aUserName : UnicodeString)
: InxModifyUser31000;

procedure GrantAdminKey(const aUserName: UnicodeString);
procedure RevokeAdminKey(const aUserName: UnicodeString);

procedure SetUserDisabled(const aUserName : UnicodeString;
aDisabled : Boolean);
procedure SetUserPassword(const aUserName : UnicodeString;
const aPassword : UnicodeString);
end;

can then be used to add/remove/modify users.

You can also get access to this functionality from any client if the session is
correctly authenticated as an administrator:

function TnxBaseSession.LoggedInAdministrator: InxLoggedInAdministrator31000;

When modifying a user, in addition to changing the read and write access flags,
it's also now possible to associate table encryption passwords with the user
account:

InxModifyUser31000 = interface(InxInvokable)
['{36B7586D-FE19-4F89-B658-8DC3B616DEFA}']
procedure AddTablePassword(const aAlias, aTable, aPassword: UnicodeString);
procedure RemoveTablePassword(const aAlias, aTable, aPassword:
UnicodeString);
procedure RemoveAllTablePasswords;

function GetIsAdmin: Boolean;
//procedure SetIsAdmin(aValue: Boolean);

function GetHasReadAccess: Boolean;
procedure SetHasReadAccess(aValue: Boolean);

function GetHasWriteAccess: Boolean;
procedure SetHasWriteAccess(aValue: Boolean);

property IsAdmin: Boolean
read GetIsAdmin{
write SetIsAdmin};
property HasReadAccess: Boolean
read GetHasReadAccess
write SetHasReadAccess;
property HasWriteAccess: Boolean
read GetHasWriteAccess
write SetHasWriteAccess;
end;

This makes it possible to use table password encryption without the encryption
password having to be exposted to the client program or user.

  #3  
Old 20th August 2012, 04:29 PM
nick nick is offline
Junior Member
 
Join Date: Feb 2012
Posts: 8
Default thanks

that was a quick reply. I am digesting it with my breakfast


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to develop with V 3.1004 Otto Herdegen nexusdb.public.support 23 17th August 2012 09:13 AM
nxserver 3.1004 crash pfau nexusdb.public.support 2 1st July 2012 11:15 AM
Crash with 3.1004 server Surjanto nexusdb.public.support 16 17th June 2012 12:29 AM
Crash with 3.1004 server Surjanto Binaries 0 21st May 2012 05:59 PM
EM 3.1004 Zoran nexusdb.public.support 4 8th March 2012 05:05 AM


All times are GMT +11. The time now is 10:11 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.