Project

General

Profile

Adding admins dynamically

Gabriel Rossetti
Added over 3 years ago

Hi all,

I need to add admins dynamically on runtime, no need to save to disk. I have a main admin that is configured in the init.properties file and users that can be admins (this info comes from another db). I successfully add those users to the in-memory global configuration (e.g. --admins) but this does not seem to be taken into account on logon nor in the command scripts. Is there a way for me to do this without having to update the file manually? Editing this file by hand is not an option. Why is this information not stored in the DB by the way, that is where the users are.

Thanks,

Gabriel


Replies (3)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Gabriel Rossetti wrote:

Hi all,

I need to add admins dynamically on runtime, no need to save to disk. I have a main admin that is configured in the init.properties file and users that can be admins (this info comes from another db). I successfully add those users to the in-memory global configuration (e.g. --admins) but this does not seem to be taken into account on logon nor in the command scripts.

Do you mean you add users to the tigase.server.BasicComponent.admins collection?

Added by Gabriel Rossetti over 3 years ago

My components can access this fine and when I logon to tigase with one of those admins I added I can now see the components in the service descovery (PSI) feature and I can call their admin scripts. However the configuration component naturally does not benifit from this (as do any other native/supplied components), is there another way to do this without subclassing the configuration component to expose this?

Thanks,

Gabriel

Added by Wojciech Kapcia TigaseTeam over 3 years ago

You should be able to access/modify this collection via (newly created) admin ad-hoc and bounded variable tigase.server.script.CommandIfc.ADMINS_SET = @adminsSet@.

    (1-3/3)