- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to assign the server admin via First Spirt access api?
Hi All,
I have to provide the server admin roles via First Spirt access api.
I tried with the setAdminMode(true), but unfortunately it is not assigning the server admin permission to the user.
user.setAdminMode(true);
Could you please help us on this?
Version : 5.1.507
Thank you!
- Labels:
-
Developers
- Tags:
- access-api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kavin,
did you checked this one?
UserStorage.setUser(user); (Write back a user to server.)?
Regards,
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Marcel Liebgott,
we tried the below code to remove the user from admin, but the changes was not reflected,
user.setAdminMode(false);
connection.getService(AdminService.class).getProjectStorage().setUser(user);
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kavin,
connection.getService(AdminService.class).getUserStorage().setUser(user);
not "getProjectStorage()"
Regard,
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marcel Liebgott,
Sorry, I have mentioned the wrong code in previous comment.
The code which I am trying is below one.
UserStorage userstorage=fsConnection.getService(AdminService.class).getUserStorage();
User user=userstorage.getUserByLogin("test");
user.setAdminMode(true);
userstorage.setUser(user);
But I am getting the exception
java.lang.SecurityException: User 'test (test)' is not a server admin
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kavin,
this is correct - the api means:
Enable admin mode for this user with extended permissions. Admin mode is enabled by default if the user is a
server admin
, but may be explicity switched off in some environments.
Regards,
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Marcel Liebgott,
As per the api documentation, only server admin's can switch to Admin mode.
boolean isServerAdmin()
Returns true
if this user is the super admin or a member of a server admin group. Only server admins are allowed to switch to admin mode
.
so, how we can promote the user as ServerAdmin.
What is the difference between AdminMode and ServerAdmin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kavin,
you can set a user as server admin in the "ServerManager".
The difference between "Server Admin" and "Admin Mode" is that the Server Admin has specific permissions to edit some server properties (in the sever manager)
Regards,
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Kavin,
no - i didn't found a public way let's wait for e-spirit support
Regards,
Marcel

