Commit Graph

42 Commits (master)

Author SHA1 Message Date
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 week ago
Faraz Samapoor a988754e3d Refactors lib/private/SystemTag.
Mainly using PHP8's constructor property promotion.

Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
7 months ago
Joas Schilling 6b7221756c
Merge pull request #39571 from nextcloud/bugfix/noid/move-lib-to-IEventDispatcher
Move lib/ events to IEventDispatcher where possible
10 months ago
Marcel Klehr 424937fd39 fix(SystemTagManager): Use truncated tagName in getTag and updateTag
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
10 months ago
Joas Schilling 6953e14580
fix: Move SystemTags events to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
10 months ago
Arthur Schiwon 49db546f78
fix: include invisible tags for admins
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
12 months ago
Arthur Schiwon 58f7fd2370
use efficient tag retrieval on DAV report request
- uses DAV search approach against valid files joined by systemtag selector
- reduced table join for tag/systemtag search
- supports pagination
- no changes to the output formats or similar

Example request body:

<?xml version="1.0"?>
<oc:filter-files xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop>
    <d:getcontentlength/>
    <d:getcontenttype/>
    <d:getetag/>
    <d:getlastmodified/>
    <d:resourcetype/>
    <nc:face-detections/>
    <nc:file-metadata-size/>
    <nc:has-preview/>
    <nc:realpath/>
    <oc:favorite/>
    <oc:fileid/>
    <oc:permissions/>
    <nc:nbItems/>
  </d:prop>
  <oc:filter-rules>
    <oc:systemtag>32</oc:systemtag>
  </oc:filter-rules>
  <d:limit>
    <d:nresults>50</d:nresults>
    <nc:firstresult>0</nc:firstresult>
  </d:limit>
</oc:filter-files>

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
12 months ago
Arthur Schiwon df662f50bd
refactor: remove where specification from SELECT getter
- search constraints are now fully in control of
  SystemTagsInFilesDetector::detectAssignedSystemTagsIn(), avoids
  duplication of a WHERE statement

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 year ago
Arthur Schiwon dbfd2f936a
refactor: remove SystemTag logic from Folder into QuerySearchHelper
- adds OC\SystemTag\SystemTagsInFilesDetector where the search logic is
  moved to

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 year ago
Côme Chilliet 9b1d7794a8 Add chunking in SystemTagObjectMapper::getTagIdsForObjects
This avoids crashing on Oracle with more than 1000 objects

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Marcel Klehr 8151b1b8b0 fix(SystemTagManager): Truncate overlong tag names
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 year ago
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Johannes Leuker d606799ee2 Add commands to manage tags via OCC
list, add, delete, edit

Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
3 years ago
Roeland Jago Douma 7e727a1a31 The objectid is a string
This allows the query to use the index. Else it has to resort on
scanning all the rows.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Morris Jobke fedf9c69d9
Use matching parameter names form interfaces and implementations
Found by Psalm 3.14.1

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 85e369cddb
Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Joas Schilling 69f2974706
Only trigger the events with tags that where actually assigned
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Joas Schilling bb352fb667
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
6 years ago
Roeland Jago Douma 8e5657014d
Make SystemTag strict
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Roeland Jago Douma 5f227bd93b
More phpstorm inspection fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7 years ago
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Jörn Friedrich Dreyer 4e1aca4e3c
don't store empty groupids
gives an exception on oracle and shouldn't be added in the first place

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Joas Schilling ba87db3fcc
Fix others 8 years ago
Vincent Petry dc21a38a85 Use named parameter instead of direct value for system tags search param (#25380) 8 years ago
Vincent Petry 8fbb63d316
Some tweaks for systemtagmanager 8 years ago
Vincent Petry 88740f035d
Act on effective system tag canAssign permission
Whenever the server returns true for the can-assign Webdav property of
a system tag, it means the current user is allowed to assign,
regardless of the value of user-assignable.

This commit brings the proper logic to the web UI to make it possible
for users to assign when they have the permission.
8 years ago
Vincent Petry b5eb3d9e5a
Add system tag assignability check with groups
Whenever a user is not an admin, a tag is visible but not
user-assignable, check whether the user is a member of the allowed
groups.
8 years ago
Vincent Petry 3cd65fe25d
Add systemtag_group table and get/set methods
Added systemtag to group mapping table.
Added methods in ISystemTagManager to get/set the group mappings.
8 years ago
Vincent Petry 09b3883d9c
Updated canUser* functions in SystemTagManager to accept objects 8 years ago
Vincent Petry 8343cfb64b
Add interface methods for permission check
Instead of checking for admin perm, use interface method
canUserAssignTag and canUserSeeTag to check for permissions.
Allows for more flexible implementation.
8 years ago
Roeland Jago Douma a1373ae259
Move \OC\SystemTag to PSR-4 8 years ago