The inside of the script in tigase/admin role is groovy?

Moffitt tig
Added about 3 years ago

def SUBMIT = "submit";

def mucRepositoryModule = (IMucRepository)mucRepository;

def Iq p = (Iq)packet;

def admins = (Set)adminsSet

def stanzaFromBare = p.getStanzaFrom().getBareJID()

def isServiceAdmin = admins.contains(stanzaFromBare)

if (!isServiceAdmin) {

def result = p.commandResult(Command.DataType.result)

Command.addTextField(result, "Error", "You do not have enough permissions to access this data.");

return result


What is this used for?

thank you!

Replies (1)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 3 years ago

This code is there to ensure that only administrator of Tigase XMPP Server will be able to execute this adhoc command even if it would be configured in other way using adhoc commands ACL configuration.