list_users()
4 Access Management and Document Sharing
In this chapter, we describe the different roles you can get a give to access your indexes, and how to use them to safely share your data. Roles are important because they determine how much users can view and modify in your data.
4.1 Access Management
In AmCAT, there are four types of roles:
- Admin: It is a user that can modify other users’ roles and perform any changes to the data.
- Writer: A user that can modify the data.
- Reader: A user that can see the data.
- Metareader: A user that can see all the data fields, but only a snippet of the text.
You can add users with their respective roles using the Graphic User Interface (GUI) or via the Application Programming Interface (API).
4.1.1 Access Managament via the Graphic User Interface
To modify the access to an index, the index has to already exist. For this example, I will refer to the index “Example Index” that we created in chapter 3 Document Storage. Nevertheless, all the steps apply to any other index.
Go ahead and open the index by clicking on it:
From there navigate to “Index Admin” located at the top of the window. In there, you will the XXX: Settings and Users.
The default settings is that yours and the guest’s roles are Metareaders. This means that both of you can only access the date, title, url etc, and snippets of the text when you search.
To change these roles, you can navigate to “Users”. This will open the following window:
From there, you can add a user by clicking “Add user”
, which will pop up the following window:
Now, you can add all the users’ emails, including your, with their respective roles. Click “Create” when you are done. To see the changes applied, you need to log-off and log-in again.
4.1.2 Access Managament via the Application Programming Interface
create_user(
email = "user@example.com",
password = "test",
global_role = "writer",
index_access = "state_of_the_union"
)
While you are here, it probably makes sense to change the admin password to something secure:
modify_user(email = "admin", new_password = "a")
add_index_user()
delete_index_user()
modify_index_user()