Skip to content

Commit bf03689

Browse files
LPD-49363 Hide the download button for guest users
1 parent ff4efcb commit bf03689

File tree

2 files changed

+9
-6
lines changed
  • modules/apps
    • frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay
    • object/object-dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/js/Attachment

2 files changed

+9
-6
lines changed

modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/liferay.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ declare module Liferay {
257257
export function getUserId(): string;
258258
export function isControlPanel(): boolean;
259259
export function isImpersonated(): boolean;
260+
export function isSignedIn(): boolean;
260261
}
261262

262263
namespace Util {

modules/apps/object/object-dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/js/Attachment/FileContainer.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ export default function FileContainer({
4141
{attachment.title}
4242
</ClayButton>
4343

44-
<a
45-
className="lfr-objects__attachment-download"
46-
href={attachment.contentURL}
47-
>
48-
<ClayIcon symbol="download" />
49-
</a>
44+
{Liferay.ThemeDisplay.isSignedIn() && (
45+
<a
46+
className="lfr-objects__attachment-download"
47+
href={attachment.contentURL}
48+
>
49+
<ClayIcon symbol="download" />
50+
</a>
51+
)}
5052

5153
{!readOnly && (
5254
<>

0 commit comments

Comments
 (0)