How to assign the server admin via First Spirt access api?
Author: kavin
Publication Date: 6/6/2016 11:31
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!
Tags: access-api
-
Author: MarsDD - 6/6/2016 14:04
Hi Kavin,
did you checked this one?
UserStorage.setUser(user); (Write back a user to server.)?
Regards,
Marcel
0 -
Author: kavin - 6/8/2016 10:20
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!
0 -
Author: MarsDD - 6/8/2016 10:27
Hi Kavin,
connection.getService(AdminService.class).getUserStorage().setUser(user);
not "getProjectStorage()"
Regard,
Marcel
0 -
Author: kavin - 6/8/2016 11:00
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!
0 -
Author: MarsDD - 6/8/2016 11:09
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
0 -
Author: kavin - 6/8/2016 11:36
Thank you Marcel Liebgott,
As per the api documentation, only server admin's can switch to Admin mode.
boolean isServerAdmin()
Returns
trueif this user is the super admin or a member of a server admin group. Only server admins are allowed toswitch to admin mode.
so, how we can promote the user as ServerAdmin.
What is the difference between AdminMode and ServerAdmin?
0 -
Author: MarsDD - 6/8/2016 11:53
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
0 -
Author: kavin - 6/8/2016 12:06
Hi Marcel Liebgott,
Is it possible to set the user as "Server admin" from API?
Thank you!
0 -
Author: MarsDD - 6/8/2016 12:17
HI Kavin,
no - i didn't found a public way :smileywink: let's wait for e-spirit support
Regards,
Marcel
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
9 Kommentare