Repository navigation
Hotfix/v2.0.4 #1954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix/v2.0.4 #1954
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1875,12 +1875,13 @@ def __init__(self): | |
| from weko_workflow.api import WorkActivity | ||
| from weko_workflow.models import ActionStatusPolicy | ||
| from weko_workflow.utils import generate_guest_activity_token_value, \ | ||
| process_send_mail | ||
| is_guest_token_issue_enabled, process_send_mail | ||
| self.__activities_id = [] | ||
| self.__activities_number = 0 | ||
| self.__work_activity = WorkActivity() | ||
| self.__action_status_policy = ActionStatusPolicy() | ||
| self.__activity_token_value = generate_guest_activity_token_value | ||
| self.__is_guest_token_issue_enabled = is_guest_token_issue_enabled | ||
| self.__process_send_mail = process_send_mail | ||
| self.__page_number = 1 | ||
| self.__usage_report_activities_data = [] | ||
|
|
@@ -1991,6 +1992,9 @@ def send_reminder_mail(self, activities_id: list, | |
| .get("WEKO_WORKFLOW_REQUEST_FOR_REGISTER_USAGE_REPORT") | ||
|
|
||
| for activity in activities: | ||
| if (activity.extra_info or {}).get('is_guest') \ | ||
| and not self.__is_guest_token_issue_enabled(): | ||
|
Comment on lines
+1995
to
+1996
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Reminders send unusable links When guest token issuance is enabled, acceptance is disabled, and a guest activity is due for a reminder, Skip sending guest reminders when guest-token acceptance is disabled. Prompt for AI agentsIn `modules/weko-admin/weko_admin/utils.py` at lines 1995-1996:
**Reminders send unusable links**
When guest token issuance is enabled, acceptance is disabled, and a guest activity is due for a reminder, `UsageReport.send_reminder_mail` checks only issuance, so it builds and sends a guest link that `validate_guest_activity_token` rejects; recipients receive a link they cannot use.
Skip sending guest reminders when guest-token acceptance is disabled. |
||
| continue | ||
|
Comment on lines
+1995
to
+1997
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Skipped guests trigger other reminder emails When the activities contain a registered-user activity followed by a guest activity while guest token issuing is disabled, Track whether any eligible guest activity was processed, and only use that state to trigger guest reminder sending. Prompt for AI agentsIn `modules/weko-admin/weko_admin/utils.py` at lines 1995-1997:
**Skipped guests trigger other reminder emails**
When the activities contain a registered-user activity followed by a guest activity while guest token issuing is disabled, `send_reminder_mail` skips a disabled guest activity but leaves it in `activity`; the later guest check at line 2027 still runs and sends every accumulated entry in `self.__mail_info_lst`, including registered-user reminders that would not be sent without `forced_send`. The caller can therefore trigger unintended reminder emails.
Track whether any eligible guest activity was processed, and only use that state to trigger guest reminder sending. |
||
| if activity.item_id: | ||
| records_id.append(activity.item_id) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,8 @@ | |
| # read_permission_factory_imp='', | ||
| # update_permission_factory_imp='', | ||
| delete_permission_factory_imp=deny_all, | ||
| create_decorators=['weko_accounts.utils:login_required_customize'], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Guests can create deposits When an unauthenticated visitor has a guest-token session and the create permission factory does not reject that visitor, Require an authenticated account for deposit creation or add a create permission check that rejects guest-token sessions. Prompt for AI agentsIn `modules/weko-deposit/weko_deposit/config.py` at line 131:
**Guests can create deposits**
When an unauthenticated visitor has a guest-token session and the create permission factory does not reject that visitor, `login_required_customize` treats the guest-token session as authenticated, so the new create decorator lets the request reach deposit creation without an authenticated account or an item-specific create check. The guest can create a deposit.
Require an authenticated account for deposit creation or add a create permission check that rejects guest-token sessions. |
||
| update_decorators=['weko_deposit.rest:require_item_edit_permission'], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High · File mutations skip edit checks
When an authenticated API caller has the write scope but lacks permission to edit the deposit,
create_blueprintattachesupdate_decoratorsonly to the item route, while file routes are registered separately; a caller with the API write scope but no item edit permission can therefore add, rename, reorder, or delete deposit files.Apply the item edit check to file mutation routes too, or configure an update permission factory that enforces per-record edit access there.
Also at
modules/weko-deposit/weko_deposit/config.py:132.Prompt for AI agents