Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/teleport/src/Main/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const fullAcl: Acl = {
nodes: fullAccess,
clipboardSharingEnabled: true,
desktopSessionRecordingEnabled: true,
directorySharingEnabled: true,
};

export const userContext = makeUserContext({
Expand Down
2 changes: 2 additions & 0 deletions packages/teleport/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { RecordingType } from 'teleport/services/recordings';
import generateResourcePath from './generateResourcePath';

const cfg = {
// TODO(isaiah): remove after feature is finished.
enableDirectorySharing: false, // note to reviewers: should be false in any PRs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice note! 👍

isEnterprise: false,
isCloud: false,
tunnelPublicAddress: '',
Expand Down
8 changes: 8 additions & 0 deletions packages/teleport/src/services/user/makeAcl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
*/

import { Acl } from './types';
import cfg from 'teleport/config';

export default function makeAcl(json): Acl {
json = json || {};
Expand Down Expand Up @@ -43,6 +44,12 @@ export default function makeAcl(json): Acl {
json.desktopSessionRecording !== undefined
? json.desktopSessionRecording
: true;
// Behaves like clipboardSharingEnabled, see
// https://github.com/gravitational/teleport/pull/12684#issue-1237830087
const directorySharingEnabled =
(json.directorySharing !== undefined ? json.directorySharing : true) &&
cfg.enableDirectorySharing;

const nodes = json.nodes || defaultAccess;

return {
Expand All @@ -64,6 +71,7 @@ export default function makeAcl(json): Acl {
clipboardSharingEnabled,
desktopSessionRecordingEnabled,
nodes,
directorySharingEnabled,
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/teleport/src/services/user/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface Access {
}

export interface Acl {
directorySharingEnabled: boolean;
desktopSessionRecordingEnabled: boolean;
clipboardSharingEnabled: boolean;
windowsLogins: string[];
Expand Down
1 change: 1 addition & 0 deletions packages/teleport/src/services/user/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ test('undefined values in context response gives proper default values', async (
},
clipboardSharingEnabled: true,
desktopSessionRecordingEnabled: true,
directorySharingEnabled: false,
},
cluster: {
clusterId: 'aws',
Expand Down