cozy-sharing 37.2.11 → 37.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [37.2.12](https://github.com/cozy/cozy-libs/compare/cozy-sharing@37.2.11...cozy-sharing@37.2.12) (2026-07-30)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **sharing:** Make shared-drive member modals consistent and correct ([9dcf67d](https://github.com/cozy/cozy-libs/commit/9dcf67d375600a1a02298dc3036880ae37d08aef))
11
+
6
12
  ## [37.2.11](https://github.com/cozy/cozy-libs/compare/cozy-sharing@37.2.10...cozy-sharing@37.2.11) (2026-07-30)
7
13
 
8
14
  **Note:** Version bump only for package cozy-sharing
package/README.md CHANGED
@@ -174,16 +174,17 @@ Link and email sharing can coexist on the same resource. The recipient's permiss
174
174
  | Org shared drive | `isOrgSharedDrive` = `sharing.drive === true && sharing.org_drive === true` | `state.js:324` |
175
175
  | `canLeave` | `false` for org shared drives | `state.js:335` |
176
176
  | `canReshare` | `!org_drive && !read_only` for drives; `open_sharing && !read_only` for folders | `state.js:342` |
177
- | Federated folder modal | Enabled by `drive.federated-shared-folder.enabled` flag | `ShareModal.jsx:39` |
177
+ | Federated folder modal | Enabled by `drive.federated-shared-folder.enabled` flag and `document.driveId` | `ShareModal.jsx:39` |
178
178
  | Email sharing in federated folder | Disabled for files inside a federated shared folder (has `driveId` but is not the root) | `FederatedFolderModal.jsx:122-126` |
179
179
  | Link sharing in federated folder | Uses `getFederatedShareLink` which resolves the owner's instance URL | `FederatedFolderModal.jsx:108-110` |
180
+ | Member view inside shared drive | Subfolder members see link management only (no member cross/perm). Root members with `canReshare` see full member management; read-only root members see link management only. | `FederatedFolderModal.jsx:118-133`, `SharingDetailsModal.jsx:38-39` |
180
181
 
181
182
  ### Share management
182
183
 
183
184
  | Condition | Rule | Source |
184
185
  |-----------|------|--------|
185
186
  | Editable modal | `isEditable = !byDocId[doc] \|\| isOwner(doc) \|\| canReshare(doc)` | `ShareModal.jsx:35-36` |
186
- | Non-editable view | `SharingDetailsModal` — read-only view of members, with revoke-self | `ShareModal.jsx:53-62` |
187
+ | Non-editable view | `SharingDetailsModal` — read-only members (no cross/perm menu), with link management (gear + copy link) for shared drives | `ShareModal.jsx:53-62` |
187
188
  | Updating member type | `updateSharingMemberType` calls `setReadOnly` / `setReadWrite` on the stack | `SharingProvider.jsx:361-420` |
188
189
  | Revoke self | Available to all recipients | `SharingProvider.jsx:349-353` |
189
190
  | Revoke group | Available to owner/editor; removes all group members at once | `SharingProvider.jsx:336-347` |
@@ -252,3 +253,4 @@ Key decisions:
252
253
  - `EditableSharingModal` renders `ShareModal` (the dumb component), which decides `ShareDialogCozyToCozy` vs `ShareDialogOnlyByLink` based on flags and context.
253
254
  - `ShareDialogTwoStepsConfirmationContainer` wraps the cozy-to-cozy dialog when recipients need confirmation (untrusted contacts).
254
255
  - Federated mode: when `drive.federated-shared-folder.enabled` is true, `FederatedFolderModal` replaces the standard `EditableSharingModal`.
256
+ - `WhoHasAccess` accepts an independent `canManageLink` prop to control link management (gear + perm dropdown) separately from `canManageMembers` which controls member management. This allows shared-drive members to see the link gear without the member cross/perm menu.
@@ -41,7 +41,7 @@ import WhoHasAccess from '../WhoHasAccess';
41
41
  var log = minilog('FederatedFolderModal');
42
42
 
43
43
  var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
44
- var _sharedDriveSharing$a, _sharedDriveSharing$a2;
44
+ var _sharedDriveSharing$a, _sharedDriveSharing$a2, _sharedDriveSharing$a3;
45
45
 
46
46
  var onClose = _ref.onClose,
47
47
  onRevokeSuccess = _ref.onRevokeSuccess,
@@ -137,7 +137,8 @@ var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
137
137
  return id === (existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument._id) || id === (existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument.id);
138
138
  }));
139
139
  var isInsideSharedDrive = Boolean((existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument.driveId) && !isSharedDriveRoot);
140
- var isCurrentUserOwner = documentId ? isOwner(documentId) : false;
140
+ var isCurrentUserOwner = existingDocument !== null && existingDocument !== void 0 && existingDocument.driveId ? Boolean(sharedDriveSharing === null || sharedDriveSharing === void 0 || (_sharedDriveSharing$a3 = sharedDriveSharing.attributes) === null || _sharedDriveSharing$a3 === void 0 ? void 0 : _sharedDriveSharing$a3.owner) : documentId ? isOwner(documentId) : false;
141
+ var isMemberReadOnly = isInsideSharedDrive && !isCurrentUserOwner;
141
142
  var hasParentRestriction = isInsideSharedDrive || hasSharedParentByPath;
142
143
  var hasChildRestriction = Boolean(documentPath && hasSharedChild(documentPath));
143
144
  var canShareByEmail = !hasParentRestriction && !hasChildRestriction;
@@ -391,6 +392,8 @@ var FederatedFolderModalContent = function FederatedFolderModalContent(_ref) {
391
392
  isOwner: isCurrentUserOwner,
392
393
  canManageSharing: canManageSharing,
393
394
  isSharedDrive: true,
395
+ canManageMembers: !isMemberReadOnly,
396
+ canManageLink: true,
394
397
  recipients: isSending ? frozenRecipients : existingRecipients,
395
398
  document: isSending ? frozenDoc : existingDocument,
396
399
  documentType: "Files",
@@ -21,7 +21,8 @@ var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
21
21
  var name = _ref.name,
22
22
  color = _ref.color,
23
23
  isOwner = _ref.isOwner,
24
- isReadOnly = _ref.isReadOnly,
24
+ _ref$canManageMembers = _ref.canManageMembers,
25
+ canManageMembers = _ref$canManageMembers === void 0 ? true : _ref$canManageMembers,
25
26
  sharingId = _ref.sharingId,
26
27
  groupIndex = _ref.groupIndex,
27
28
  _ref$read_only = _ref.read_only,
@@ -49,7 +50,7 @@ var GroupRecipientPermissions = function GroupRecipientPermissions(_ref) {
49
50
  revoking = _useState4[0],
50
51
  setRevoking = _useState4[1];
51
52
 
52
- var shouldShowMenu = !isReadOnly && !revoking && (isOwner || isUserInsideMembers);
53
+ var shouldShowMenu = canManageMembers && !revoking && (isOwner || isUserInsideMembers);
53
54
 
54
55
  var toggleMenu = function toggleMenu() {
55
56
  return setMenuDisplayed(!isMenuDisplayed);
@@ -14,7 +14,8 @@ var MemberRecipientPermissions = function MemberRecipientPermissions(_ref) {
14
14
  var isOwner = _ref.isOwner,
15
15
  _ref$canManageSharing = _ref.canManageSharing,
16
16
  canManageSharing = _ref$canManageSharing === void 0 ? isOwner : _ref$canManageSharing,
17
- isReadOnly = _ref.isReadOnly,
17
+ _ref$canManageMembers = _ref.canManageMembers,
18
+ canManageMembers = _ref$canManageMembers === void 0 ? true : _ref$canManageMembers,
18
19
  status = _ref.status,
19
20
  instance = _ref.instance,
20
21
  type = _ref.type,
@@ -36,7 +37,7 @@ var MemberRecipientPermissions = function MemberRecipientPermissions(_ref) {
36
37
 
37
38
  var instanceMatchesClient = instance !== undefined && instance === client.options.uri;
38
39
  var contactIsOwner = status === 'owner';
39
- var shouldShowMenu = !isReadOnly && !revoking && !contactIsOwner && (instanceMatchesClient && !isOwner || canManageSharing);
40
+ var shouldShowMenu = canManageMembers && !revoking && !contactIsOwner && (instanceMatchesClient && !isOwner || canManageSharing);
40
41
  var handleRevocation = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
41
42
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42
43
  while (1) switch (_context.prev = _context.next) {
@@ -10,8 +10,8 @@ var RecipientList = function RecipientList(_ref) {
10
10
  recipientsToBeConfirmed = _ref.recipientsToBeConfirmed,
11
11
  isOwner = _ref.isOwner,
12
12
  canManageSharing = _ref.canManageSharing,
13
+ canManageMembers = _ref.canManageMembers,
13
14
  isSharedDrive = _ref.isSharedDrive,
14
- isReadOnly = _ref.isReadOnly,
15
15
  document = _ref.document,
16
16
  documentType = _ref.documentType,
17
17
  onRevoke = _ref.onRevoke,
@@ -28,7 +28,7 @@ var RecipientList = function RecipientList(_ref) {
28
28
  if (isGroupRecipient) {
29
29
  return /*#__PURE__*/React.createElement(GroupRecipient, _extends({}, recipient, {
30
30
  isOwner: isOwner,
31
- isReadOnly: isReadOnly,
31
+ canManageMembers: canManageMembers,
32
32
  key: recipient.index,
33
33
  document: document,
34
34
  documentType: documentType,
@@ -42,8 +42,8 @@ var RecipientList = function RecipientList(_ref) {
42
42
  key: recipient.index,
43
43
  isOwner: isOwner,
44
44
  canManageSharing: canManageSharing,
45
+ canManageMembers: canManageMembers,
45
46
  isSharedDrive: isSharedDrive,
46
- isReadOnly: isReadOnly,
47
47
  document: document,
48
48
  documentType: documentType,
49
49
  onRevoke: onRevoke,
@@ -30,8 +30,7 @@ export var ShareModal = withLocales(function (props) {
30
30
  canReshare = _useSharingContext.canReshare,
31
31
  documentType = _useSharingContext.documentType,
32
32
  getRecipients = _useSharingContext.getRecipients,
33
- revokeSelf = _useSharingContext.revokeSelf,
34
- allLoaded = _useSharingContext.allLoaded;
33
+ revokeSelf = _useSharingContext.revokeSelf;
35
34
 
36
35
  var handleRevokeSelf = /*#__PURE__*/function () {
37
36
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(document) {
@@ -61,7 +60,7 @@ export var ShareModal = withLocales(function (props) {
61
60
  if (isEditable) {
62
61
  var isFederatedMode = flag('drive.federated-shared-folder.enabled');
63
62
 
64
- if (isFederatedMode && allLoaded) {
63
+ if (isFederatedMode && document.driveId) {
65
64
  return /*#__PURE__*/React.createElement(FederatedFolderModal, _extends({
66
65
  document: document,
67
66
  onRevokeSuccess: onRevokeSuccess
@@ -1,7 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
3
+ import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
4
4
  import { useI18n } from 'twake-i18n';
5
+ import { useSharingContext } from '../../hooks/useSharingContext';
5
6
  var styles = {
6
7
  "share-modal-content": "share__share-modal-content___1iqEq",
7
8
  "coz-form": "share__coz-form___1ICST",
@@ -20,6 +21,7 @@ var styles = {
20
21
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
21
22
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG"
22
23
  };
24
+ import ShareByLink from '../ShareByLink';
23
25
  import WhoHasAccess from '../WhoHasAccess';
24
26
  export var SharingDetailsModal = function SharingDetailsModal(_ref) {
25
27
  var recipients = _ref.recipients,
@@ -33,7 +35,13 @@ export var SharingDetailsModal = function SharingDetailsModal(_ref) {
33
35
  var _useI18n = useI18n(),
34
36
  t = _useI18n.t;
35
37
 
36
- return /*#__PURE__*/React.createElement(Dialog, {
38
+ var _useSharingContext = useSharingContext(),
39
+ getSharingLink = _useSharingContext.getSharingLink,
40
+ getFederatedShareLink = _useSharingContext.getFederatedShareLink;
41
+
42
+ var isSharedDrive = Boolean(document === null || document === void 0 ? void 0 : document.driveId);
43
+ var displayedLink = isSharedDrive ? getFederatedShareLink(document) : getSharingLink(document === null || document === void 0 ? void 0 : document._id);
44
+ return /*#__PURE__*/React.createElement(FixedDialog, {
37
45
  disableGutters: true,
38
46
  open: true,
39
47
  onClose: onClose,
@@ -42,14 +50,23 @@ export var SharingDetailsModal = function SharingDetailsModal(_ref) {
42
50
  content: /*#__PURE__*/React.createElement("div", {
43
51
  className: styles['share-modal-content']
44
52
  }, /*#__PURE__*/React.createElement(WhoHasAccess, {
45
- isReadOnly: true,
53
+ canManageMembers: false,
54
+ canManageLink: isSharedDrive,
55
+ isSharedDrive: isSharedDrive,
46
56
  recipients: recipients,
47
57
  document: document,
48
58
  documentType: documentType,
49
59
  onRevoke: onRevoke,
50
60
  onRevokeSelf: onRevokeSelf,
51
- link: "ok"
52
- }))
61
+ link: displayedLink
62
+ })),
63
+ actions: isSharedDrive && /*#__PURE__*/React.createElement(ShareByLink, {
64
+ link: displayedLink,
65
+ document: document,
66
+ documentType: "Files",
67
+ showGenerateLinkButton: true,
68
+ autoOpenShareRestriction: false
69
+ })
53
70
  });
54
71
  };
55
72
  SharingDetailsModal.propTypes = {
@@ -37,6 +37,10 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
37
37
  isSharedDrive = _ref2$isSharedDrive === void 0 ? false : _ref2$isSharedDrive,
38
38
  _ref2$isReadOnly = _ref2.isReadOnly,
39
39
  isReadOnly = _ref2$isReadOnly === void 0 ? false : _ref2$isReadOnly,
40
+ _ref2$canManageMember = _ref2.canManageMembers,
41
+ canManageMembers = _ref2$canManageMember === void 0 ? !isReadOnly : _ref2$canManageMember,
42
+ _ref2$canManageLink = _ref2.canManageLink,
43
+ canManageLink = _ref2$canManageLink === void 0 ? canManageMembers : _ref2$canManageLink,
40
44
  _ref2$showOwner = _ref2.showOwner,
41
45
  showOwner = _ref2$showOwner === void 0 ? true : _ref2$showOwner,
42
46
  recipients = _ref2.recipients,
@@ -63,7 +67,7 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
63
67
  }, /*#__PURE__*/React.createElement(RecipientWaitingForConfirmationAlert, {
64
68
  recipientsToBeConfirmed: recipientsToBeConfirmed
65
69
  }), /*#__PURE__*/React.createElement(List, null, link && /*#__PURE__*/React.createElement(LinkRecipient, {
66
- isReadOnly: isReadOnly,
70
+ isReadOnly: !canManageLink,
67
71
  document: document,
68
72
  documentType: documentType,
69
73
  onRevoke: onRevoke,
@@ -78,8 +82,8 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
78
82
  recipientsToBeConfirmed: recipientsToBeConfirmed,
79
83
  isOwner: isOwner,
80
84
  canManageSharing: canManageSharing,
85
+ canManageMembers: canManageMembers,
81
86
  isSharedDrive: isSharedDrive,
82
- isReadOnly: isReadOnly,
83
87
  document: document,
84
88
  documentType: documentType,
85
89
  onRevoke: onRevoke,
@@ -92,6 +96,8 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
92
96
  WhoHasAccess.propTypes = {
93
97
  isOwner: PropTypes.bool,
94
98
  canManageSharing: PropTypes.bool,
99
+ canManageMembers: PropTypes.bool,
100
+ canManageLink: PropTypes.bool,
95
101
  showOwner: PropTypes.bool,
96
102
  recipients: PropTypes.array.isRequired,
97
103
  recipientsToBeConfirmed: PropTypes.arrayOf(PropTypes.shape({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "37.2.11",
3
+ "version": "37.2.12",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -59,7 +59,7 @@
59
59
  "cozy-intent": "^2.31.1",
60
60
  "cozy-minilog": "^3.10.1",
61
61
  "cozy-ui": "^140.5.0",
62
- "cozy-ui-plus": "^12.3.5",
62
+ "cozy-ui-plus": "^12.3.6",
63
63
  "jest": "30.3.0",
64
64
  "jest-environment-jsdom": "30.3.0",
65
65
  "react": "16.12.0",
@@ -85,5 +85,5 @@
85
85
  "sideEffects": [
86
86
  "*.css"
87
87
  ],
88
- "gitHead": "163abe4aea6ccd37e5b6a256f30b081be81c0661"
88
+ "gitHead": "8dbc03f6ef437764cfec18a0b2a6e1b44102f7c3"
89
89
  }
@@ -118,7 +118,12 @@ const FederatedFolderModalContent = ({
118
118
  const isInsideSharedDrive = Boolean(
119
119
  existingDocument?.driveId && !isSharedDriveRoot
120
120
  )
121
- const isCurrentUserOwner = documentId ? isOwner(documentId) : false
121
+ const isCurrentUserOwner = existingDocument?.driveId
122
+ ? Boolean(sharedDriveSharing?.attributes?.owner)
123
+ : documentId
124
+ ? isOwner(documentId)
125
+ : false
126
+ const isMemberReadOnly = isInsideSharedDrive && !isCurrentUserOwner
122
127
  const hasParentRestriction = isInsideSharedDrive || hasSharedParentByPath
123
128
  const hasChildRestriction = Boolean(
124
129
  documentPath && hasSharedChild(documentPath)
@@ -322,6 +327,8 @@ const FederatedFolderModalContent = ({
322
327
  isOwner={isCurrentUserOwner}
323
328
  canManageSharing={canManageSharing}
324
329
  isSharedDrive
330
+ canManageMembers={!isMemberReadOnly}
331
+ canManageLink={true}
325
332
  recipients={isSending ? frozenRecipients : existingRecipients}
326
333
  document={isSending ? frozenDoc : existingDocument}
327
334
  documentType="Files"
@@ -20,7 +20,7 @@ const GroupRecipientPermissions = ({
20
20
  name,
21
21
  color,
22
22
  isOwner,
23
- isReadOnly,
23
+ canManageMembers = true,
24
24
  sharingId,
25
25
  groupIndex,
26
26
  read_only = false,
@@ -36,7 +36,7 @@ const GroupRecipientPermissions = ({
36
36
  const [revoking, setRevoking] = useState(false)
37
37
 
38
38
  const shouldShowMenu =
39
- !isReadOnly && !revoking && (isOwner || isUserInsideMembers)
39
+ canManageMembers && !revoking && (isOwner || isUserInsideMembers)
40
40
 
41
41
  const toggleMenu = () => setMenuDisplayed(!isMenuDisplayed)
42
42
  const hideMenu = () => setMenuDisplayed(false)
@@ -12,7 +12,7 @@ import { PermissionTypeMenu } from './PermissionTypeMenu'
12
12
  const MemberRecipientPermissions = ({
13
13
  isOwner,
14
14
  canManageSharing = isOwner,
15
- isReadOnly,
15
+ canManageMembers = true,
16
16
  status,
17
17
  instance,
18
18
  type,
@@ -31,7 +31,7 @@ const MemberRecipientPermissions = ({
31
31
  instance !== undefined && instance === client.options.uri
32
32
  const contactIsOwner = status === 'owner'
33
33
  const shouldShowMenu =
34
- !isReadOnly &&
34
+ canManageMembers &&
35
35
  !revoking &&
36
36
  !contactIsOwner &&
37
37
  ((instanceMatchesClient && !isOwner) || canManageSharing)
@@ -10,8 +10,8 @@ const RecipientList = ({
10
10
  recipientsToBeConfirmed,
11
11
  isOwner,
12
12
  canManageSharing,
13
+ canManageMembers,
13
14
  isSharedDrive,
14
- isReadOnly,
15
15
  document,
16
16
  documentType,
17
17
  onRevoke,
@@ -35,7 +35,7 @@ const RecipientList = ({
35
35
  <GroupRecipient
36
36
  {...recipient}
37
37
  isOwner={isOwner}
38
- isReadOnly={isReadOnly}
38
+ canManageMembers={canManageMembers}
39
39
  key={recipient.index}
40
40
  document={document}
41
41
  documentType={documentType}
@@ -52,8 +52,8 @@ const RecipientList = ({
52
52
  key={recipient.index}
53
53
  isOwner={isOwner}
54
54
  canManageSharing={canManageSharing}
55
+ canManageMembers={canManageMembers}
55
56
  isSharedDrive={isSharedDrive}
56
- isReadOnly={isReadOnly}
57
57
  document={document}
58
58
  documentType={documentType}
59
59
  onRevoke={onRevoke}
@@ -23,8 +23,7 @@ export const ShareModal = withLocales(props => {
23
23
  canReshare,
24
24
  documentType,
25
25
  getRecipients,
26
- revokeSelf,
27
- allLoaded
26
+ revokeSelf
28
27
  } = useSharingContext()
29
28
 
30
29
  const handleRevokeSelf = async document => {
@@ -37,7 +36,7 @@ export const ShareModal = withLocales(props => {
37
36
 
38
37
  if (isEditable) {
39
38
  const isFederatedMode = flag('drive.federated-shared-folder.enabled')
40
- if (isFederatedMode && allLoaded) {
39
+ if (isFederatedMode && document.driveId) {
41
40
  return (
42
41
  <FederatedFolderModal
43
42
  document={document}
@@ -1,10 +1,12 @@
1
1
  import PropTypes from 'prop-types'
2
2
  import React from 'react'
3
3
 
4
- import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
4
+ import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
5
5
  import { useI18n } from 'twake-i18n'
6
6
 
7
+ import { useSharingContext } from '../../hooks/useSharingContext'
7
8
  import styles from '../../styles/share.styl'
9
+ import ShareByLink from '../ShareByLink'
8
10
  import WhoHasAccess from '../WhoHasAccess'
9
11
 
10
12
  export const SharingDetailsModal = ({
@@ -16,9 +18,15 @@ export const SharingDetailsModal = ({
16
18
  onClose
17
19
  }) => {
18
20
  const { t } = useI18n()
21
+ const { getSharingLink, getFederatedShareLink } = useSharingContext()
22
+
23
+ const isSharedDrive = Boolean(document?.driveId)
24
+ const displayedLink = isSharedDrive
25
+ ? getFederatedShareLink(document)
26
+ : getSharingLink(document?._id)
19
27
 
20
28
  return (
21
- <Dialog
29
+ <FixedDialog
22
30
  disableGutters
23
31
  open={true}
24
32
  onClose={onClose}
@@ -27,16 +35,29 @@ export const SharingDetailsModal = ({
27
35
  content={
28
36
  <div className={styles['share-modal-content']}>
29
37
  <WhoHasAccess
30
- isReadOnly
38
+ canManageMembers={false}
39
+ canManageLink={isSharedDrive}
40
+ isSharedDrive={isSharedDrive}
31
41
  recipients={recipients}
32
42
  document={document}
33
43
  documentType={documentType}
34
44
  onRevoke={onRevoke}
35
45
  onRevokeSelf={onRevokeSelf}
36
- link="ok"
46
+ link={displayedLink}
37
47
  />
38
48
  </div>
39
49
  }
50
+ actions={
51
+ isSharedDrive && (
52
+ <ShareByLink
53
+ link={displayedLink}
54
+ document={document}
55
+ documentType="Files"
56
+ showGenerateLinkButton={true}
57
+ autoOpenShareRestriction={false}
58
+ />
59
+ )
60
+ }
40
61
  />
41
62
  )
42
63
  }
@@ -32,6 +32,8 @@ const WhoHasAccess = ({
32
32
  canManageSharing = isOwner,
33
33
  isSharedDrive = false,
34
34
  isReadOnly = false,
35
+ canManageMembers = !isReadOnly,
36
+ canManageLink = canManageMembers,
35
37
  showOwner = true,
36
38
  recipients,
37
39
  recipientsToBeConfirmed = [],
@@ -58,7 +60,7 @@ const WhoHasAccess = ({
58
60
  <List>
59
61
  {link && (
60
62
  <LinkRecipient
61
- isReadOnly={isReadOnly}
63
+ isReadOnly={!canManageLink}
62
64
  document={document}
63
65
  documentType={documentType}
64
66
  onRevoke={onRevoke}
@@ -80,8 +82,8 @@ const WhoHasAccess = ({
80
82
  recipientsToBeConfirmed={recipientsToBeConfirmed}
81
83
  isOwner={isOwner}
82
84
  canManageSharing={canManageSharing}
85
+ canManageMembers={canManageMembers}
83
86
  isSharedDrive={isSharedDrive}
84
- isReadOnly={isReadOnly}
85
87
  document={document}
86
88
  documentType={documentType}
87
89
  onRevoke={onRevoke}
@@ -97,6 +99,8 @@ const WhoHasAccess = ({
97
99
  WhoHasAccess.propTypes = {
98
100
  isOwner: PropTypes.bool,
99
101
  canManageSharing: PropTypes.bool,
102
+ canManageMembers: PropTypes.bool,
103
+ canManageLink: PropTypes.bool,
100
104
  showOwner: PropTypes.bool,
101
105
  recipients: PropTypes.array.isRequired,
102
106
  recipientsToBeConfirmed: PropTypes.arrayOf(