Library Quota for User Groups and Users Blueprint

Introduction

Design and Implement a change to the Xibo CMS so that Users and User Groups can have a library quota which they are not able to exceed.

Status

The current status and the username of the:

  • Status = Drafting
  • Reporter = @laercionit
  • Drafter = @dasgarner
  • Implementer = @dasgarner

User Story

Installations which provide access to multiple customers (many customers in one CMS) may want to grant user group / user quotas in order to control the amount of content uploaded by those customers.

Implementation

The quota should be set on the user or user group record and represented in KB. The quota value on the most specific record should always prevail. This means that if a user has a quota that is higher than the quota for any groups they belong to, their own personal quota should be applied. For example consider:

Example 1

User A, belongs to Group A and Group B. Group A has a quota of 10 MB, Group B has a quota of 20 MB. There is currently 8 MB of media in the library owned by User A. They are trying to upload a 10 MB file, should it be allowed?

Answer: No

Example 2

User A belongs to Group A. Group A has a quota of 10 MB, User A has a quota of 20 MB. There is currently 8 MB of media in the library owned by User A. The are trying to upload a 10 MB file, should it be allowed?

Answer: Yes

Effected Software

Xibo CMS

  • Modify the User Add / Edit forms to allow entry of the Library Quota
  • Modify the User Group Add / Edit forms to allow entry of the Library Quota
  • Modify the Library Add / Edit forms to check the User Library Usage against the User Library Quota. This should be done outside the Data class (will need access to the user object).

Xibo API

  • Hook into file upload and media add routines to raise errors when the user library quota is exceeded.

DB Schema Changes

  • Settings on User Group record (user specific groups and multi-user groups) called group.libraryQuota. INT datatype. Represents KB.

GitHub

For clarities sake, is quota applied to the group split amongst those users (ie so in total, members of the group can upload files to that limit), or is it so that users in that group each individually get to upload files up to that limit?

It would be split amongst the users equally.

It would also be worth mentioning that a user/group quota split won’t really work at present, because groups are never “owners” of items, only users are.

That means if a group has 10MB quota, but one of the users has 1GB quota… that user can “lock out” all the other users by consuming far beyond 10MB.

Done, implemented and tested (in May)

I’ll close this topic now.