-
Notifications
You must be signed in to change notification settings - Fork 154
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
navbar: add cog menu #2471
navbar: add cog menu #2471
Conversation
jrcastro2
commented
Oct 4, 2023
•
edited
Loading
edited
- closes https://github.com/zenodo/rdm-project/issues/262
38554c8
to
0d1aeab
Compare
invenio_app_rdm/theme/views.py
Outdated
"administration.users", | ||
_("Manage user"), | ||
order=2, | ||
endpoint_arguments_constructor=lambda: {"q": f"id:{current_user.id}"}, |
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.
Comment for reviewers, in the issue is specified to use the email. However if the preferences of the visibility are not set to public we cannot find the user by using the email, therefore I added the id that will always find the user (when searching as admin)
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.
I remember if you are user manager (role) you are supposed to be able to access the email field regardless if the email is visible or not (that is why in the admins search we can see all the users' emails - to be verified).
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.
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.
Nice finding! thanks for checking this.
in this case I think we are just missing User manager generator (or permission?) in a right place for searching emails:
I think it is better to handle it by permissions rather than trying to circumvent it via ID. maybe makes sense to discuss during the standup?
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.
The email is not indexed if the user profile is set to hidden, therefore no one can search for it as it's not available, agreed over chat that we will use the username instead, which unique and indexed all the time and only admins can search for it.
72f6110
to
f103548
Compare
@@ -126,6 +126,7 @@ def record_detail( | |||
pid_value, record, files, media_files, is_preview=False, include_deleted=False | |||
): | |||
"""Record detail page (aka landing page).""" | |||
record_owner = current_rdm_records.records_service.get_owner(pid_value) |
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.
Comment for reviewers:This returns the User model object which has no dict representation. As I commented here, maybe we should consider creating an interface for the owner as it could potentially be something different than a user.
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.
record is already resolved here, can't we resolve the owner directly?
f103548
to
405a114
Compare
const handleError = (errorMessage) => { | ||
console.error(errorMessage); | ||
this.setState({ error: errorMessage }); | ||
}; | ||
|
||
return ( | ||
<Grid columns={1} className="record-management"> | ||
{permissions.can_edit && !isDraft && ( | ||
{permissions.can_manage && ( |
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.
shouldn't be this can_moderate
? Are we exposing the manage button to record owners/curators ?
3e80c8b
to
3edbd0e
Compare
3edbd0e
to
cf8f668
Compare