User Management
  • 23 Mar 2022
  • 1 Minute to read
  • Dark
    Light

User Management

  • Dark
    Light

Ant Media supports different user roles. You can, for example, create an admin user to virtually do everything to read-only users, who only can view the dashboard and not do something harmful like removing an application. These permission models are both in API and Ant Media administration tools.

User Roles:

AMS dashboard users can only view applications and sections of the dashboard they have been given access to. There are 3 types of user access in the AMS dashboard:

  • Admin can do anything in its scope, e.g can CRUD anything and access all web panel services.
  • User can do anything in the dashboard for particular applications granted. He cannot see or modify other applications.
  • Read-only user can read anything in the dashboard for applications granted. This user cannot access web panel services, create an application, or start a broadcast.

Creating Users roles in Ant Media Server

Just need to navigate Settings text on the left menu. After that click Users section and click New User button. Just fill the blanks according to your use case.

multi-tenancy-create-user

After login with your new User, you will see likely as below:

specific-application-admin-user-dashboard

How to use Multi-Tenancy with REST API?

Please take a look at the answer here to learn
how to access web panel REST methods programmatically

Create User

Web panel has the following REST method to create users for applications

@POST
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)

It means that you can call the following method to create a user with curl.

curl -X POST -H "Content-Type: application/json" -d '{"email": "test", "password": "testtest", "scope": "system", "userType": "ADMIN"}'  "https://{YOUR_SERVER_ADDRESS}:5443/rest/v2/users"

Edit User

Web panel has the following REST method to edit user for applications

@PUT
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)

It means that you can call the following method to edit a user with curl.

curl -X PUT -H "Content-Type: application/json" -d '{"email": "test", "password": "testtest", "scope": "system", "userType": "USER"}'  "https://{YOUR_SERVER_ADDRESS}:5443/rest/v2/users"

Note: scope parameter can be system or specific application name such as LiveApp. If you use LiveApp user scope is will only LiveApp. system can reach everywhere in application scopes.

userType parameter can be ADMIN, USER or READ-ONLY.

Remove User

Web panel has the following REST method to create user for applications

@DELETE
@Path("/users/{username}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)

It means that you can call the following method to remove a user with curl.

curl -X DELETE -H "Content-Type: application/json" "https://{YOUR_SERVER_ADDRESS}:5443/rest/v2/users/{username}"

Was this article helpful?