nextcloud / nextcloud/server

Incorrect behavior of tag assignment rules in files_automatedtagging

Open
#59,496 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: tags feature: workflows
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Hello!

I have Nextcloud 32.0.6 installed on RedOS 8.0.2, along with php 8.3, apache http, and mariadb.

Using the Organization folders app, I have prepared the directory structure for our organization. Some folders contain subfolders (configured as Sub-Resources) and files. All of them should be non-deletable and non-editable by regular users.

Ideally, everything created by a regular user should be deleted after 1 week.

For this purpose, the following tags have been created:

Admin (invisible)

Users (invisible)

I have assigned the Admin tag to all organizational folders and files. It was automatically assigned to all folders and files via a script, and it is visible in the browser under the administrator account!

Objective: All files and folders created by a regular user should be assigned the Users tag. However, where the Admin tag is already assigned, the Users tag should not be assigned! For example, if the parent folder already has the Admin tag, the Users tag should not be assigned. Subsequently, through the Retention files app, folders/files with the Users tag should be deleted.

I created a rule through the Files automated tagging app to assign the Users tag to files and folders that do not have the Admin tag and belong to users in the Users group.

I created a rule for assigning the Users tag:

Group membership - is a member - users;

File tag - file is not tagged - Admin;

However, nothing created by the user is marked with the Users tag! The rule is not working correctly.

Then I tried another rule for assigning the Users tag:

Group membership - is a member - users;

File tag - file is tagged - Admin;

In this case, everything created by the user is incorrectly marked with the Users tag! As a result, through the Retention_files app, all files with the Users tag will be deleted, regardless of whether there is an Admin tag or not. This is very bad.

Finally, I tried another rule for assigning the Users tag:

Group membership - is a member - users;

File tag - file is tagged - Admin;

MIME type - not equal to - Directory;

In this case, when a User copies files, these files are assigned the Users tag, but the parent folder does not receive this tag (which is good). However, any new folder created by the User does not receive this tag, which is very bad.

There is an incorrect reaction to the rule “File tag - file is not tagged (or file is tagged) - Admin”.

How can I ensure that all files/folders created by a regular user are assigned the Users tag, while not assigning the Users tag where the Admin tag is already present?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three rules in the files_automatedtagging app with the Admin and Users tags, using both files and folders created by regular users. Compare the results for “file is tagged” and “file is not tagged”; done means the rule behavior matches the stated exclusions for Admin-tagged items while tagging eligible files and folders.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.