Search code examples
javaandroidadminopenfiresmack

Smack + openfire - Is it possible to check the current user is administrator or not? / How to check current user details?


Is it possible to check if the current user is administrator or not / How to check current user details?(Java smack + openfire in Android)?
When I try to create user on openfire admin web page. There is a option:
Is Administrator? (Grants admin access to Openfire)
It is possible to know if the current user has admin access to Openfire? (I mean in smack, how to check the current user is administrator of OpenFire)


Solution

  • Try this,

     account = Connection.getAccountManager();
     Collection<String> attrs = account.getAccountAttributes();
     //inspect the values in attrs, should contain the type of account
    

    Ok.. on the user creation page.

    Is Administrator? --> means that if u want to grant admin priviledges to the user that you are creating. A admin user will have all the rights to create/delete user, session, groups etc. You may not want to provide admin previledges to all the users.

    If You want to know if the current user or any other user that exists has admin priviledges, then goto

    User/Groups-->Users-->User Summary (here you will get all the users in the system)

    The current logged in user will be denoted by a star next to it. (i think) Click on the user, then it will give a summary of the user. The Is Administrator?: property will be yes or no accordingly.