Webui userquotas / groupquotas improperly requires users to exist on server in order to remove a quota in bulk change tool

Description

This area of webui could use some significant attention IMHO. 12.0 was supposed to have the ability to add / modify / delete these in bulk. Deletion is accomplished by setting quota_value to 0 removes the quota. The original reason for the "Add" or "Bulk" option is because the API allows setting multiple quotas at once (which we want to do because there may be a server where 100+ entries need to be changed - preferably at one time).

Quotas reference ids (either UID or GID). If a user quota is added to a server for "bob" with UID 1000, and then "bob" is deleted, the quota will still exist, but the lookups for UID 1000 will of course fail. This means that no part of the webui dealing with on-disk permissions or user/group quotas should ever rely exclusively on the ability to resolve a UID / GID into a username / groupname. If for some reason "Select users cached by this system" needs a list of users for checkboxes, then it must also include all ids returned by pool.get_quota for the dataset in question. If you do not include them, then users have no mechanism to bulk remove existing user / group quotas.

API for pool.set_quota is as follows:
```
@accepts(
Str('ds', required=True),
List('quotas', items=[
Dict(
'quota_entry',
Str('quota_type',
enum=['DATASET', 'USER', 'USEROBJ', 'GROUP', 'GROUPOBJ'],
required=True),
Str('id', required=True),
Int('quota_value', required=True, null=True),
)
], default=[{
'quota_type': 'USER',
'id': '0',
'quota_value': 0
}])
)
@returns()
@item_method
async def set_quota(self, ds, data):
"""
There are three over-arching types of quotas for ZFS datasets.
1) dataset quotas and refquotas. If a DATASET quota type is specified in
this API call, then the API acts as a wrapper for `pool.dataset.update`.
2) User and group quotas. These limit the amount of disk space consumed
by files that are owned by the specified users or groups. If the respective
"object quota" type is specfied, then the quota limits the number of objects
that may be owned by the specified user or group.
3) Project quotas. These limit the amount of disk space consumed by files
that are owned by the specified project. Project quotas are not yet implemended.
This API allows users to set multiple quotas simultaneously by submitting a
list of quotas. The list may contain all supported quota types.
`ds` the name of the target ZFS dataset.
`quotas` specifies a list of `quota_entry` entries to apply to dataset.
`quota_entry` entries have these required parameters:
`quota_type`: specifies the type of quota to apply to the dataset. Possible
values are USER, USEROBJ, GROUP, GROUPOBJ, and DATASET. USEROBJ and GROUPOBJ
quotas limit the number of objects consumed by the specified user or group.
`id`: the uid, gid, or name to which the quota applies. If quota_type is
'DATASET', then `id` must be either `QUOTA` or `REFQUOTA`.
`quota_value`: the quota size in bytes. Setting a value of `0` removes
the user or group quota.
"""
```

Problem/Justification

None

Impact

None

Activity

Show:

Ievgen Stepanovych April 26, 2022 at 4:50 PM

Bug Clerk April 8, 2022 at 7:26 PM

Bug Clerk March 31, 2022 at 10:34 PM

Complete

Details

Assignee

Reporter

Labels

Time remaining

0m

Components

Fix versions

Affects versions

Priority

Katalon Platform

Created March 2, 2022 at 7:15 PM
Updated July 1, 2022 at 5:58 PM
Resolved April 26, 2022 at 4:50 PM