Difference between revisions of "Creating users"
From Protege Wiki
(New page: __NOTOC__ == Creating users programmatically in client-server mode == In client-server mode (multi-user mode), one can create a user/password programmatically with the following code: <c...) |
(→Creating users programmatically in client-server mode) |
||
Line 23: | Line 23: | ||
'''[[Note:]]''' | '''[[Note:]]''' | ||
− | The server is configured by default not to allow the creation of new users in the UI (this does not apply to the programmatic access). To enable the creation of users in the UI, add in the protege.properties file from the Protege installation directory the following line: | + | The server is configured by default not to allow the creation of new users in the UI (this does not apply to the programmatic access). To enable the creation of users in the UI, add in the protege.properties file from the Protege installation directory '''on the server''' the following line: |
<code><pre> | <code><pre> | ||
server.allow.create.users=false | server.allow.create.users=false | ||
</pre></code> | </pre></code> |
Revision as of 13:02, March 13, 2008
Creating users programmatically in client-server mode
In client-server mode (multi-user mode), one can create a user/password programmatically with the following code:
try {
server = (RemoteServer) Naming.lookup("//" + serverName + "/" + Server.getBoundName());
//optional - check if the server allows the creation of new users
//boolean allowsUserCreate = server.allowsCreateUsers();
server.createUser(username, password);
} catch (Exception e) {
Log.getLogger().severe(Log.toString(e));
}
After creating a new user, the server will automatically save the metaproject file.
Note:
The server is configured by default not to allow the creation of new users in the UI (this does not apply to the programmatic access). To enable the creation of users in the UI, add in the protege.properties file from the Protege installation directory on the server the following line:
server.allow.create.users=false