Skip to content

Commit ac80cb8

Browse files
committed
docs: add pages for teams, team folders and the Teams API
Teams and team folders had no page in any manual. "Team folder" appeared 19 times across the three manuals - activity, encryption, primary storage, trashbin, automated tagging - always in passing and never defined, and the Teams API had no developer documentation at all even though it has existed since 29.0.0 and Files, Talk and Deck implement it. Adds one page per manual: - user: what a team is and is not, that it owns nothing until it has a team space, roles, and an FAQ - admin: team folders versus team spaces, which teams are eligible, the circles app settings that gate provisioning, detach versus delete, and an FAQ - developer: ITeamResourceProvider, ITeamManager, TeamResource and the ITeamFolderProvider added in 35.0.0, with registration and the existing implementations Assisted-by: AGENT:claude-opus-5[1m] Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 3ed736d commit ac80cb8

6 files changed

Lines changed: 315 additions & 0 deletions

File tree

admin_manual/configuration_files/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ File sharing and management
88

99
file_sharing_configuration
1010
federated_cloud_sharing_configuration
11+
team_folders
1112
big_file_upload_configuration
1213
default_files_configuration
1314
primary_storage
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
============================
2+
Team folders and team spaces
3+
============================
4+
5+
Team folders are folders that are mounted for a set of groups or teams rather than owned by one account. They are
6+
provided by the **Team folders** app, whose app id is ``groupfolders`` - the name you will see in :command:`occ`
7+
commands, in the app store and in log entries.
8+
9+
A **team space** is a team folder in an exclusive relationship with a single team: it belongs to that team, follows
10+
the team's membership, and has its own quota. Team spaces were introduced in Nextcloud 35.
11+
12+
Team folder or team space?
13+
--------------------------
14+
15+
.. list-table::
16+
:header-rows: 1
17+
:widths: 30 35 35
18+
19+
* -
20+
- Team folder
21+
- Team space
22+
* - Mounted for
23+
- any number of groups and teams
24+
- exactly one team
25+
* - Created by
26+
- an administrator or a delegated group
27+
- the team owner, or an administrator
28+
* - Membership follows
29+
- the groups and teams you assign
30+
- the team's own membership
31+
* - Quota
32+
- set per folder
33+
- set per space
34+
35+
Which teams can have a space
36+
----------------------------
37+
38+
A team is not eligible for a team space if it is:
39+
40+
- a **personal** team,
41+
- a **hidden** team,
42+
- a **system** team, or
43+
- a team provided by an **external backend**.
44+
45+
For every other team, the **owner** or a server administrator can add a space. Members, moderators and team admins
46+
cannot.
47+
48+
Configuration
49+
-------------
50+
51+
Team space provisioning is controlled by two app settings of the ``circles`` app. Neither is exposed in the
52+
administration interface, so set them with :command:`occ`:
53+
54+
.. code-block:: bash
55+
56+
# allow teams to be created with a space, and existing teams to be upgraded (default: yes)
57+
occ config:app:set circles team_folder_auto_create --value=1 --type=boolean
58+
59+
# default quota in bytes for a new team space; 0 means unlimited (default: 0)
60+
occ config:app:set circles team_folder_default_quota --value=0 --type=integer
61+
62+
With provisioning disabled, requests to create or upgrade a team space are refused, and existing spaces are left
63+
untouched.
64+
65+
.. note::
66+
67+
A team space is only created at team-creation time if the person creating the team asks for one. Teams created
68+
without a space are not upgraded automatically; someone has to upgrade them deliberately.
69+
70+
Detaching versus deleting
71+
-------------------------
72+
73+
.. warning::
74+
75+
These two actions look similar and are not.
76+
77+
**Detaching** ends the exclusive relationship and **keeps the folder and its contents**. The folder remains as an
78+
ordinary team folder that you can reassign to groups, teams or nobody. This is the intended way to recover access to
79+
the contents of a team that is being disbanded.
80+
81+
**Deleting** removes the team folder and everything in it.
82+
83+
How team folders interact with other features
84+
---------------------------------------------
85+
86+
Team folders behave differently from ordinary user storage in several areas that are documented elsewhere:
87+
88+
- :doc:`encryption_configuration` - encrypting team folders and other non-home mount points.
89+
- :doc:`primary_storage` - how team folder contents are stored on object storage.
90+
- :doc:`trashbin_configuration` - deleted files from a team folder go to the team folder's own trash.
91+
- :doc:`../configuration_server/activity_configuration` - activities for team folders, and why they can be missing.
92+
93+
Frequently asked questions
94+
--------------------------
95+
96+
**A user says their team cannot own any files. Is that expected?**
97+
Yes. A team is a membership list; anything shared with it stays owned by the account that shared it. For storage
98+
owned by the team, the team needs a space, which its owner can add if provisioning is enabled.
99+
100+
**Why is the option to add a space missing for one particular team?**
101+
Either provisioning is disabled server-wide, or the team is not eligible - personal, hidden, system and
102+
backend-provided teams cannot have a space. The person asking may also not be the team's owner.
103+
104+
**Can I convert an existing team folder into a team's space?**
105+
Yes. An existing team folder can be linked to a team instead of creating a new one, which is the way to migrate a
106+
folder that predates team spaces.
107+
108+
**How do I take a space away from a team without losing the data?**
109+
Detach it. The folder and its contents survive; only the exclusive relationship ends.
110+
111+
**Does a team space count against the members' quotas?**
112+
No. It has its own quota, set per space, where zero means unlimited.

developer_manual/digging_deeper/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Digging deeper
1010
auth
1111
direct_editing
1212
groupware_workflows
13+
teams
1314
discovery
1415
devtools
1516
internals
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
=====
2+
Teams
3+
=====
4+
5+
Teams are user-defined groups of accounts, provided by the **Teams** app (app id ``circles``). Apps do not store
6+
anything in a team themselves: they *contribute* to it, by telling the server which of their own resources are shared
7+
with a given team. A team's overview is assembled from every app that does so.
8+
9+
The API lives in the ``OCP\Teams`` namespace and has been available since Nextcloud 29.
10+
11+
Contributing resources to a team
12+
--------------------------------
13+
14+
Implement ``OCP\Teams\ITeamResourceProvider`` and register it from your ``Application`` class:
15+
16+
.. code-block:: php
17+
18+
<?php
19+
namespace OCA\MyApp\AppInfo;
20+
21+
use OCA\MyApp\Teams\MyAppResourceProvider;
22+
use OCP\AppFramework\App;
23+
use OCP\AppFramework\Bootstrap\IBootContext;
24+
use OCP\AppFramework\Bootstrap\IBootstrap;
25+
use OCP\AppFramework\Bootstrap\IRegistrationContext;
26+
27+
class Application extends App implements IBootstrap {
28+
public function register(IRegistrationContext $context): void {
29+
$context->registerTeamResourceProvider(MyAppResourceProvider::class);
30+
}
31+
32+
public function boot(IBootContext $context): void {
33+
}
34+
}
35+
36+
The provider answers three questions about your app's resources:
37+
38+
.. code-block:: php
39+
40+
interface ITeamResourceProvider {
41+
public function getId(): string; // your provider id, e.g. 'deck'
42+
public function getName(): string; // translated, shown to users
43+
public function getIconSvg(): string; // inline SVG
44+
45+
/** @return TeamResource[] resources of yours shared with this team */
46+
public function getSharedWith(string $teamId): array;
47+
48+
public function isSharedWithTeam(string $teamId, string $resourceId): bool;
49+
50+
/** @return string[] team ids a resource of yours is shared with */
51+
public function getTeamsForResource(string $resourceId): array;
52+
}
53+
54+
Each resource is returned as an ``OCP\Teams\TeamResource``, carrying the provider, an id, a label, a URL and an icon
55+
- as inline SVG, a URL or an emoji.
56+
57+
.. note::
58+
59+
A resource contributed this way is still owned by whoever created it. Nothing about registering a provider makes
60+
the team the owner of anything.
61+
62+
Reading teams and their resources
63+
---------------------------------
64+
65+
``OCP\Teams\ITeamManager`` is the consumer side:
66+
67+
.. code-block:: php
68+
69+
$providers = $teamManager->getProviders(); // since 29.0.0
70+
$provider = $teamManager->getProvider('deck'); // since 29.0.0
71+
$resources = $teamManager->getSharedWith($teamId, $userId); // since 29.0.0
72+
$teams = $teamManager->getTeamsForResource('deck', $boardId, $userId); // since 29.0.0
73+
$teams = $teamManager->getTeamsForUser($userId); // since 33.0.0
74+
$lists = $teamManager->getSharedWithList($teams, $userId, $resourceId); // since 33.0.0
75+
$members = $teamManager->getMembersOfTeam($teamId, $userId); // since 34.0.0
76+
77+
``getSharedWithList()`` gained its ``$resourceId`` parameter in 34.0.0, so guard for the server version if your app
78+
supports older releases.
79+
80+
The team folder provider
81+
------------------------
82+
83+
Since Nextcloud 35 a team can also have **one exclusive folder** - a team space. That folder is supplied by an
84+
implementation of ``OCP\Teams\ITeamFolderProvider``, which extends ``ITeamResourceProvider``:
85+
86+
.. code-block:: php
87+
88+
interface ITeamFolderProvider extends ITeamResourceProvider {
89+
public function getTeamFolder(string $teamId): ?TeamFolder;
90+
public function createTeamFolder(Team $team, int $quota = 0): TeamFolder; // quota 0 = unlimited
91+
public function getLinkableTeamFolders(string $circleId): array;
92+
public function linkTeamFolder(string $circleId, int $folderId): TeamFolder;
93+
public function updateTeamFolderQuota(string $teamId, int $quota): TeamFolder;
94+
public function unlinkTeamFolder(string $teamId): ?TeamFolder; // keeps the folder
95+
public function removeTeamFolder(string $teamId): bool; // deletes the folder
96+
}
97+
98+
Implementations are registered the same way as any other resource provider, through
99+
``registerTeamResourceProvider()``. Retrieve the active one with ``ITeamManager::getTeamFolderProvider()``, which
100+
returns ``null`` when no app provides team folders - always handle that case.
101+
102+
.. warning::
103+
104+
``unlinkTeamFolder()`` ends the relationship and preserves the folder and its contents; ``removeTeamFolder()``
105+
deletes them. If you expose either in a user interface, make the difference obvious.
106+
107+
Implementations to look at
108+
--------------------------
109+
110+
- **Files** - ``FileSharingTeamResourceProvider`` in the ``circles`` app, for files and folders shared with a team.
111+
- **Talk** - ``TalkTeamResourceProvider`` in ``spreed``, for conversations.
112+
- **Deck** - ``DeckTeamResourceProvider``, for boards.
113+
- **Team folders** - ``TeamSpaceProvider`` in ``groupfolders``, the reference implementation of
114+
``ITeamFolderProvider``.

user_manual/groupware/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ You can find out more about Nextcloud Groupware `on our website <https://nextclo
1515
:maxdepth: 1
1616

1717
contacts
18+
teams
1819
calendar
1920
mail
2021
absence

user_manual/groupware/teams.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
=====
2+
Teams
3+
=====
4+
5+
A team is a group of accounts that any user can create and manage themselves, without an administrator having to set
6+
up a system group. Teams can be shared with in the same places a group can: files and folders, Talk conversations and
7+
Deck boards.
8+
9+
Teams are managed in the **Teams** app, which has its own entry in the app navigation. On servers where that interface
10+
has been disabled, team management appears in the **Contacts** app instead.
11+
12+
What a team is, and what it is not
13+
----------------------------------
14+
15+
A team is a **membership list**, not a storage location. Anything shared with a team stays owned by the account that
16+
shared it, and stops being available to the team when that account removes the share or is deleted.
17+
18+
This surprises people who expect a team to work like a shared drive:
19+
20+
.. note::
21+
22+
Creating a team does not create any storage. Until the team has a **team space**, there is nowhere to put a file
23+
that belongs to the team rather than to one of its members.
24+
25+
Team spaces
26+
-----------
27+
28+
A team space is a folder that belongs to the team itself. It follows the team's membership, so a new member gains
29+
access and a removed member loses it, and it has its own storage quota.
30+
31+
A team space can be created in two ways:
32+
33+
- **When the team is created**, by asking for one at the same time.
34+
- **Later**, by upgrading an existing team, if your server allows it.
35+
36+
Only the **team owner** or a server administrator can add a team space to a team. Some teams can never have one:
37+
personal teams, hidden teams, and teams that are managed by the server or by an external backend.
38+
39+
.. warning::
40+
41+
Detaching a space from a team and deleting it are different actions. **Detaching keeps the folder and everything
42+
in it** - it simply stops belonging to the team, and an administrator can reassign it. **Deleting removes the
43+
folder and its contents.**
44+
45+
Team roles
46+
----------
47+
48+
Teams support four roles:
49+
50+
**Member**
51+
The lowest level of permissions. A member can access the resources shared with the team and see who else is in it.
52+
53+
**Moderator**
54+
In addition to member permissions, a moderator can invite people, confirm invitations and manage members.
55+
56+
**Admin**
57+
In addition to moderator permissions, an admin can configure the team's options.
58+
59+
**Owner**
60+
In addition to admin permissions, an owner can transfer ownership to another member, and is the only role that can
61+
add a team space. A team has exactly one owner.
62+
63+
Frequently asked questions
64+
--------------------------
65+
66+
**I created a team, but I cannot create files or folders that belong to it.**
67+
A team is a group of people, not a place to store things. Files, conversations and boards can be *shared with* a
68+
team, but they remain owned by whoever created them. For storage owned by the team, ask for a **team space** - see
69+
above. If the option is missing, your administrator has disabled it.
70+
71+
**What is the difference between a team space and a folder I shared with my team?**
72+
A shared folder belongs to you: it disappears from the team if you unshare it or your account is removed. A team
73+
space belongs to the team and survives changes in membership, including yours.
74+
75+
**What happens to the files if the space is detached from the team?**
76+
Nothing is deleted. The folder and its contents remain, and an administrator can attach it to another team or hand
77+
it back to individual users. Deleting the space is a separate, destructive action.
78+
79+
**Who can add a team space?**
80+
The team owner, or a server administrator. Moderators and admins of the team cannot.
81+
82+
**Can a team have more than one space?**
83+
No. The relationship is exclusive: one team, at most one team space.
84+
85+
**Which apps can show things in a team?**
86+
Any app that integrates with teams. Out of the box this includes Files, Talk and Deck.

0 commit comments

Comments
 (0)