Skip to content

feat(classification): add watermarking to security controls) - #2807

Merged
feixuanli merged 2 commits into
box:masterfrom
feixuanli:feat-security-controls
Jan 21, 2022
Merged

feat(classification): add watermarking to security controls)#2807
feixuanli merged 2 commits into
box:masterfrom
feixuanli:feat-security-controls

Conversation

@feixuanli

@feixuanli feixuanli commented Jan 20, 2022

Copy link
Copy Markdown

Screen Shot 2022-01-19 at 10 47 57 PM
![Screen Shot 2022-01-19 at 10 47 34 PM](h
Screen Shot 2022-01-19 at 10 47 29 PM
Screen Shot 2022-01-19 at 10 47 34 PM

@feixuanli
feixuanli requested a review from a team as a code owner January 20, 2022 07:21
@feixuanli
feixuanli force-pushed the feat-security-controls branch from a02502a to a18be37 Compare January 20, 2022 07:23
accessLevel: SharedLinkAccessLevel,
};

type watermarkApplied = {

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.

Would it be preferable to name this consistently like WatermarkRestriction, or is there a reason why a different convention was used in this case?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Was discussing with Yuvnesh on this, watermarking is not considered as a restriction like the other controls, though we have it as part of access policy, which is also why we are printing it with an extra bullet point in the short version.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy in admin console:
Screen Shot 2022-01-20 at 3 08 36 PM


const getWatermarkingMessages = (controls: Controls): Array<MessageItem> => {
const items = [];
const isWatermarkEnabled = getProp(controls, `${WATERMARK}.enabled`);

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.

nit: Might be good to add a default false value, in case this object is missing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated


if (download) {
return { message: messages.shortDownload };
switch (true) {

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.

I feel like this was a bit simpler before. I think ideally the switch would be used for enums and each case would match a unique value, but here all cases resolve to true. I think the same logic should be possible with the existing ifs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I was thinking about this too, using existing ifs we would now gotta concat each with else ifs since we don't return immediately, looks a bit bulky. Let me know how you think ?

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.

I think the else if would be easier to understand and would result in less lines of code. A switch of boolean values where all the cases resolve to true is not a common usage and feels like it could be error prone.


if (app) {
return { message: messages.shortApp };
if (watermark) {

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.

So far we've only displayed a single bullet for the short version of the summary. Just to confirm: does product/design want to make an exception for watermarking?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes confirm this is desired with Product.

@feixuanli
feixuanli force-pushed the feat-security-controls branch from a18be37 to ff36f12 Compare January 20, 2022 23:30
@feixuanli
feixuanli force-pushed the feat-security-controls branch from ff36f12 to a7f6498 Compare January 21, 2022 17:59
@feixuanli
feixuanli merged commit c278167 into box:master Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants