Managing Access Control
HydroServer's access control is role-based and set at the Workspace level. The person who creates the workspace is automatically the owner. That user can then share the workspace with any other HydroServer user as a collaborator. Unless workspace creation has been disabled by a HydroServer administrator, users can create multiple workspaces and can be a collaborator on any number of workspaces.
Workspace and Content Ownership
Ownership of resources in HydroServer is user-centric, meaning that individual user accounts own the sites, metadata, and datastreams within a workspace. A user may be associated with an organization, but it is the user's account that maintains ownership of and control over the data.
All resources in HydroServer (monitoring sites, metadata, datastreams, observations) are handled within the context of a workspace. When you want to create a new site, you first have to decide which workspace it will belong to. It will inherit all of the permissions of that workspace.
User Roles
Each collaborator on a workspace is assigned a role. A role is a set of permissions configurable at the resource level. The workspace owner has full control of the workspace. By default, HydroServer also deploys with Editor, Viewer, and Data Loader roles that can be assigned to collaborators and service accounts, and an administrator can configure additional roles if needed. The following table gives an overview of permissions associated with the owner and HydroServer's default roles:
| Permission | Owner | Editor | Viewer | Data Loader |
|---|---|---|---|---|
| Rename, transfer, edit privacy of workspace | Yes | No | No | No |
| Invite new workspace collaborators | Yes | Yes | No | No |
| Create, update, delete sites, datastreams, and metadata | Yes | Yes | No | No |
| Stream observations into datastreams (e.g., with the SDL) | Yes | Yes | No | Yes |
| Set up Job Orchestration System tasks | Yes | Yes | No | No |
| View public and private data within workspace | Yes | Yes | Yes | Yes |
Adding Collaborators to a Workspace
To add a collaborator, open Manage workspaces, select the workspace, and open the Collaborators tab.

If your workspace is new and you are the owner, you will be the only member. Click Add collaborator, enter the collaborator's email address, choose an available role, and click Add collaborator again to save.
NOTE: A person must have a HydroServer user account affiliated with their email address before you can add them as a collaborator on a workspace.
Use the actions in a collaborator's row to edit their role or remove them from the workspace.
Service Accounts and API Keys
Sometimes you want to provide access to a workspace without using a person's username and password. HydroServer uses service accounts for these automated clients. Each service account has its own API key and receives permissions through a workspace role.
API keys are unique secrets that let remote systems connect to HydroServer. Assign the service account the minimum permissions it needs, such as the Data Loader role for uploading observations.
To create one, open Manage workspaces, select the workspace, open the Service accounts tab, and click Create service account. Give it a name and description, choose the service account's role, and save.

The generated API key is shown once. Copy it immediately and store it securely. If it is lost, regenerate the service account's key; the previous key will stop working.

To use the key, send it in the X-Api-Key header of each API request, or paste it into a client such as the Streaming Data Loader. See Authenticating.
Granular Data Visibility
In addition to HydroServer's workspace level, role-based access control, workspace collaborators can control several visibility settings that control what public HydroServer users see. Public users are those who are not logged in or those who are logged in but not a collaborator on a workspace.
By default, workspaces, sites, and datastreams are public. However, each has a visibility setting that can make them private.
Workspace Privacy: This setting determines whether a workspace is private or public. If your workspace is private, all sites, datastreams, and associated metadata will only be accessible to the workspace owner and collaborators. You can set the privacy of your workspace when it is created, or later by selecting the workspace on the Manage workspaces page and opening the Privacy tab.
Site Privacy: This setting determines whether your monitoring site is private or public. If you set your site to private, it means that only the workspace owners and collaborators can view the site and all associated datastreams through the website or API. This is like having a closed folder that only selected people can open. This allows users to set some sites as public and others as private within a public workspace. Site privacy can be set by clicking the 'Access control' button on the site's landing page.
Datastream Privacy: This setting is about who can see a specific datastream at your site. Even if your site is public, you might want to keep certain datastreams of that site private. When this setting is on, it means that only the workspace owners and collaborators can view this particular datastream's details and data. Datastream privacy can be set using the buttons to the right of the datastream on the site's landing page.
Datastream Data Download Restriction: When this setting is on, the public can't download or query the datastream's data, through the Data Management Web Application or any API, including the SensorThings API and CSV downloads. The datastream and its metadata stay public, including its observation count and the time range its observations cover, so guests can see that the data exists, but can't download or query it. Only the workspace owner and collaborators whose role can view observations can download and query the data. Data download restriction can be set using the buttons to the right of the datastream on the site's landing page.
HydroServer checks privacy at all three levels. A datastream and its observations are publicly accessible only when its workspace, monitoring site, and the datastream itself are all public.
Making a site private blocks public access to its datastreams and observations. Each datastream keeps its own privacy (datastream.isPrivate) and data download restriction (datastream.isRestricted) settings.
For example, if you make the site public again and its workspace is also public, datastreams that were public before become publicly accessible again. Datastreams marked private stay private, and datastreams with restricted data download stay restricted.
Datastream privacy and data download restriction are independent settings. A private datastream hides its data whether or not its data download is restricted, but its restriction setting is kept. If you make a datastream private and then public again, its data download restriction is unchanged.
