Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Update the permission check of add/delete item's categories and tags#312

Merged
yiyione merged 9 commits intomasterfrom
yiyi/category_and_tag_permission
Jun 21, 2021
Merged

Update the permission check of add/delete item's categories and tags#312
yiyione merged 9 commits intomasterfrom
yiyi/category_and_tag_permission

Conversation

@yiyione
Copy link
Contributor

@yiyione yiyione commented Jun 10, 2021

Add or delete item's tag/category will require item's write permission.

Only admin can set category official example.
Only admin have write permission to the official example items.

@yiyione yiyione requested a review from a team as a code owner June 10, 2021 09:27
@yiyione yiyione requested a review from debuggy June 10, 2021 09:28
@hippogr
Copy link

hippogr commented Jun 11, 2021

}

it is almost the same logic as checkReadPermission, try to merge them?


Refers to: rest_server/src/controllers/item_controller.js:52 in a8ef127. [](commit_id = a8ef127, deletion_comment = False)

@hippogr
Copy link

hippogr commented Jun 11, 2021

}

I mean we can abstract them out into one subfunction


In reply to: 859187634


Refers to: rest_server/src/controllers/item_controller.js:52 in a8ef127. [](commit_id = a8ef127, deletion_comment = False)

@yiyione
Copy link
Contributor Author

yiyione commented Jun 11, 2021

}

it is almost the same logic as checkReadPermission, try to merge them?

Refers to: rest_server/src/controllers/item_controller.js:52 in a8ef127. [](commit_id = a8ef127, deletion_comment = False)

Merged, call checkWritePermission inside function checkReadPermission to remove the duplicate code.

Copy link

@hippogr hippogr left a comment

Choose a reason for hiding this comment

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

:shipit:

@yiyione yiyione merged commit fc2afc1 into master Jun 21, 2021
@yiyione yiyione deleted the yiyi/category_and_tag_permission branch June 21, 2021 07:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants