Commit Graph
78 Commits
Author SHA1 Message Date
Thomas Ramé 3f9936f632 wip 2026-07-30 19:14:02 +02:00
Thomas Ramé cdabae5791 wip pending encryption 2026-04-22 12:22:05 +02:00
Thomas Ramé a19eedef88 wip autosave error 2026-04-13 17:54:40 +02:00
Thomas Ramé 7202645caa wip 2026-04-09 14:53:58 +02:00
Thomas Ramé be4b0f2929 wip 2026-04-02 17:25:25 +02:00
neilcroft c4188f8342 🐛(backend) fix hard delete of files created by other users
Allow folder owners/admins to hard delete files in their trashbin
even when the file was created by another user.

Fixes #604
2026-03-23 12:58:44 +01:00
Manuel Raynaud f09d6d15a9 ✨(backend) new action to duplicate a file item
A user with at leat editor role, connected can duplicate a file item
which has its upload_state ready. The duplicate_file task is used to do
the copy of the file on the storage.
2026-03-20 13:30:51 +01:00
Manuel Raynaud 238d6eb92e ✨(backend) add a task to duplicate a file
We plan to add an action to duplicate an item. We want to use a celery
task to make the copy using the s3 client. The task is retried 10 times
if failing and then the item is deleted if the copy fail after 10
retriees.
2026-03-20 13:30:51 +01:00
Manuel Raynaud b91c2d1777 🛂(backend) add duplicate in the item abilities
In order to add in next commit a duplicate action in the ItemViewset, we
add a `duplicate` entry in the item abilities. A user can duplicate a
file if he can update it.
2026-03-20 13:30:51 +01:00
Julien Maupetit 42e2a4bb1a 🔧(backend) update maximal line length to 100
We should be consistent between tools configuration (ruff and pylint).
2026-03-11 16:37:10 +01:00
Manuel Raynaud 725bf12564 🐛(backend) stop storing numchild in database use annotation instead
In the item model the properties numchild and numchild_folder must be
maintain by doing a +/- 1 operation in several actions. Maintaining is
error prone, hard to catch and can have lot of root cause we can't
identified. We choose to use annotation instead and to compute the value
when needed.
2026-03-05 14:16:22 +01:00
Manuel Raynaud bd44d4aab8 🐛(backend) allow inviting external person on item with no direct access
When a user with priviledged role on an item but inherited he can not
invite external person. We refacto the invitation viewset, serializer
and permission to check roles against all the tree.
2026-03-03 14:46:54 +01:00
Manuel Raynaud 4e5aefce27 ✨(backend) add a download action returning the media url
The media url is subject to change if the file is renamed. If someone is
using it as a permalink, it will lose the ability to download the file.
We created a new download action, always returning a redirection to the
media url.
2026-02-24 15:30:51 +01:00
Nathan Vasse ea3a1d1bd5 ✨(backend) add last_release_note_seen field to user
Allow users to track which release note they last saw.
Also support its edition. This will let the
frontend know whether to display new release notes.
2026-02-12 09:54:52 +01:00
Quentin BEYandManuel Raynaud ae206fa8be 🚸(oidc) ignore case when fallback on email
Some identity providers might change the case, but in our
products we don't consider case variation to be consider as
different email addresses.

Next step would be to normalize the DB value of email to
be lower-case.
2026-02-11 19:22:00 +01:00
Manuel Raynaud 0b4326aa8f ♻️(backend) save item to mirror in the database
In order to be more fault tolerant, to not lose data if the redis is
reset, etc. We decided to put the item to mirror in a new table and then
the task will manage the status in the database.
This is the first step to then add tasks in the admin to retry or check
why the task has failed and also implement a retry strategy.

The Dockerfile must also be modified, we need the libmagic library to
build the image at the collect stage because the magic module is
imported in the storage module and all tasks are imported when the
application starts.
2026-02-10 10:11:18 +01:00
Manuel Raynaud 5106f34a90 ♻️(backend) increase user short_name field length
The user's short_name field length was set to 20. This is not enought
and we have some users who cannot register because of that. We changed
this length to a higher one, 100, like the full_name.
2026-02-09 18:10:03 +01:00
Manuel Raynaud 6899f02e8d ♻️(backend) force link_reach to be in sync with parents
For the same reason we not create an access when a child is created, we
have to not set value to link_reach allowing null value. A root will
have the link_reach set to restricted when created and then every
children are set to null. when the link_configuration will be updated,
descendants will be sync when the new link_reach is higher than the
previous one. Also move scenarios are impacted. When moving to the root,
we force the link_reach to restricted and when moving in an existing
item, we sync it with parents.
2026-02-06 15:58:19 +01:00
Manuel Raynaud dad6e1cb12 ♻️(backend) change max_ancestors_role for inherited in access list
Once all accesses filtered, we need to check it we have to change the
max_ancestors_role for accesses that are inherited. An inherited access is will
not have the same item_id than the current item used in this viewset. In that
case, we use the role of the current access and the item_id it is related to.
2026-02-06 15:58:18 +01:00
Nathan VasseandManuel Raynaud 825146466e ✨(backend) allow to move item to root
We need to be able to detach a child from its parents to bring it
back to the root.
2026-02-06 15:39:35 +01:00
Manuel Raynaud 7e6d7023ef 🐛(backend) fix set_to_role on non explicit access
On a non explicit access, when the set_to_role is computed and there is
no ancestors_role, we must use the current role as max role.
2026-02-06 15:39:31 +01:00
Manuel Raynaud 45989c725c 🔥(backend) stop creating a default workspace on user creation
We don't want anymore to create a default main workspace when a user is
created. All code related to this workspace creation is deleted.
2026-02-06 15:39:30 +01:00
Manuel Raynaud a76698cad3 ⚡️(backend) reduce queries made in item access list viewset
The ItemAvvessViewset list endpoint is really complicated and half of
the algo is made to cache the role the current user have on the tree.
This code is now removed and replaced by a queryset annotation allowing
to fetch the user_roles and then determine in the model the max role the
user have on the tree. It reduces the number of sql query by 1 and ease
the code comprehension
2026-02-06 15:39:29 +01:00
Manuel Raynaud ff831e0404 ✨(backend) add the id of the max anestor role item in the access
For a given access we are able to compute the max ancestors role. We
also need the item_id related to this max_ancestors_role. We compute it
both in the vewset and in the models like we already did for the
max_ancestors_role
2026-02-06 15:39:28 +01:00
Manuel Raynaud db4e6afc49 ♻️(backend) set_role_to min role to max_ancestors_role for is_explicit
The set_role_to was computed to have only roles strictly higher than the
max_ancestors_role. We want this behavior only for inherited accesses.
When the role is explicit, we want to allow the lower role in
set_role_to equal to max_ancestors_role
2026-02-06 15:39:28 +01:00
Manuel Raynaud 45a19908bc ✨(backend) compute max_ancestors_role in ItemAccess if not present
The max_ancestors_role was only computes in the ItemAccessViewSet.list
method to avoid having to compute it multiple times in the list and then
in the serializer. The result is save in the model instance has a cache,
but if not present whe computing the abilities outside the list method,
then the expected abilities are wrong. The set_role_to can't be computed
without it. So we search for the max_ancestors_role in the class itself
if not set.
2026-02-06 15:39:26 +01:00
Manuel Raynaud f696568e6c ♻️(backend) manage role inheritence for item accesses
We need to manage inheritence on item accesses. We backport all the work
made on the docs project. To list accesses, we look for all accesses on
all the item ancestors and the item itself.
2026-02-06 15:39:26 +01:00
Manuel Raynaud c39b93a2ac ♻️(backend) remove BaseAccess model
The BaseAccess model was only used by the ItemAccess model. We remove it
in order to refactor later the get_abilities method.
2026-02-06 15:39:25 +01:00
Manuel Raynaud d78876bf9c ♻️(backend) simplify permissions and serializers
Some permissions were made in the BaseAccessSerializer. Permissions
should not occur in serializers. We refactor this, moving permission
check in permissions classes but also in the ItemAccessViewset. Also,
there is no need to keep the BaseAccessPermission
2026-02-06 15:39:24 +01:00
Manuel Raynaud e0948905fc ♻️(backend) factorize item query set annotation
The methods to annotate an item queryset were factorized on the
viewset but the correct place is the custom queryset itself now that
we have one.
2026-02-06 15:39:24 +01:00
Manuel Raynaud 926396c622 ✨(backend) expose ancestors and computed linked
We want to display on an item the ancestors and computed links (reach
and role) as inherited from its ancestors.
2026-02-06 15:39:24 +01:00
Manuel Raynaud 9ada2dc664 ♻️(backend) compute abilities based on ancestors
We need to compute the abilities based on ancestors link_reach and
link_role. Gor this we added methods on the Item model computing them
and storing them in a local cache to not compute them again and again in
the same request.
2026-02-06 15:39:23 +01:00
Manuel Raynaud a094dfc267 ♻️(backend) use choices from lasuite package
The choices RoleChoices, LinkReachChoices and LinkRoleChoices are moved
in the djano-lasuite project, we can remove them from drive and use them
from the library.
2026-02-06 15:39:22 +01:00
Samuel Paccoud - DINUMandManuel Raynaud c9bfdb9fcb ⚡️(backend) avoid N+1 queries to compute link reach/role on chidren view
The link reach/role on an item is derived from its ancestors. Pre-computing
values for each item allows passing them in a mapping that avoids repeated
queries when computing each item's abilities.
2026-01-07 11:25:26 +01:00
Samuel Paccoud - DINUMandManuel Raynaud a42e802f8f ⚡️(backend) avoid N+1 queries to compute nb_accesses on children list
We can calculate a child's number of accesses by adding the count for its
parent item and adding the count directly attached to it. This addition
can be done in the same list query via an annotation so we don't generate
N+1 queries (N equals 200 by default on the children view).
2026-01-07 11:23:47 +01:00
Sylvain ZimmerandNathan Vasse 971433ff75 🐛(email) avoid trying to send emails if no provider is configured
We want to allow instance to not setup email sending without causing
crashes. Also add the envvar to the test setup so that the existing
tests that were running without DJANGO_EMAIL_HOST to None still
work.
2025-12-18 14:36:30 +01:00
Nathan Vasse 0ffa133900 ✨(back) add claims to user
We'll need to store claims for each users in order to expose
them later on usage metrics route.
2025-12-01 11:11:29 +01:00
Manuel RaynaudandNathan Panchout af26a14b8b ✨(backend) expose a breadcrumb endpoint for an item
For a given item we want to retrieve its breadcrumb, to create a
breadcrum component in the frontend application. This breadcrumb return
a flat list of items order by their path depth.
2025-11-17 15:40:26 +01:00
Manuel Raynaud 3382ad93c1 🐛(backend) filter invitation with case insensitive email
A user can be invited and no control is made on the email case. Then,
when a new user is created, we are looking if there are pending
invitation and the lookup used is case sensitive. We change it using
__iexact which is case insensitive.
2025-11-17 15:13:59 +01:00
Manuel Raynaud 644920028d ✨(back) use discovery url to configure wopi
in the wopi protocol, a wopi client should expose a discovery url
allowing the host to configure the url to use based on the extension or
the file mimetype. We use now this discovery url to configure the wopi
host and remove all the existing mechanism made in the settings.
2025-09-26 16:01:14 +02:00
Manuel Raynaud 749f7de956 ✨(back) create item endpoint creating a WOPI session
In order to start a WOPI session, we have to fetch an endpoint on the
item viewset returing the access token, the access token ttl and the
wopi client launch url.
2025-09-24 19:31:58 +02:00
Manuel Raynaud f1f143d96d ✨(backend) save malware info in itam when analysis is unsafe
When the analysis is unsafe, we save the result in the item model in
order to keep the information for further usage.
2025-09-02 09:41:28 +02:00
Nathan PanchoutandManuel Raynaud 027c60214c ✨(backend) add creator id field in Item serializer
Added the creator id field to ListItemSerializer and ItemSerializer to
enhance data representation and facilitate access to the creator's
identifier in the serialized output.
2025-09-02 09:41:26 +02:00
Manuel Raynaud 49c200f768 ✨(backend) configure lasuite.malware_detection module
We want to use the malware_detection module from lasuite library. We add
a new setting MALWARE_DETECTION to configure the backend we want to use.
The callback is also added. It removes the file if it is not safe and
update the item upload state accordongly.
2025-09-02 09:41:08 +02:00
Manuel Raynaud 793294f677 ♻️(back) manage title uniqueness by generating new one if existing
For now it wasn't possible to create twice an item with the same title
in the same path and an exception was raised. We change it by
incrementing a version number in the item title. It is still not
possible to have twice the same title but the item is created with a
different one.
2025-08-18 11:38:08 +02:00
Manuel Raynaud 06a56eea17 🐛(backend) stop decreasing twice the numchild in deletion process
In the deletion process we maintain the numchild property by decreasing
when the item is soft deleted. But the delete method is also decreasing
it. We must only rely on the soft delete process and ensure that an item
can not be deleted if it was not solft_deleted first.
Fixes #261
2025-07-28 11:44:24 +02:00
Nathan Vasse 13e7381c24 ♻️(back) set user language default to none
By setting the default language to none delegate the language
detection to the frontend that uses the browser's configuration.
2025-06-26 16:36:23 +02:00
Manuel Raynaud 2e8077f7e8 ♻️(back) move check constraint on filename in save method
The check constraint on the filename can be moved in the save method. A
check constraint will execute a sql query and in this case it is not
needed, we have all the element needed to do this check in the python
code and not in the database. This will reduce the number queries on
every save.
2025-06-23 11:40:34 +02:00
AbderrahmaneandNathan Vasse 253104ec65 ✏️(backend) fix typos in models docstrings
Corrected “am item” to “an item” in LinkTrace and Invitation docstrings.

Signed-off-by: Abderrahmane <abderrahmanedouhaa@gmail.com>
2025-06-05 16:02:36 +02:00
Nathan Vasse f39bcacf96 🐛(back) fix mail language and url
The link in the link was not correct, also added french translation
for the sent mails. The language used was not the language of the user,
I replaced with the most up to date approach used on Docs.
2025-05-21 17:13:14 +02:00