Skip to content
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

[SYNPY-1348] Add User profile and Permission models #1058

Merged
merged 8 commits into from
Jan 30, 2024

Conversation

BryanFauble
Copy link
Contributor

Problem:

  1. User profile and permissions need to be added to the OOP model

Solution:

  1. Adding models to the client

Testing:

  1. The sample script
  2. Integration/unit tests

@BryanFauble BryanFauble requested a review from a team as a code owner January 30, 2024 00:40
@pep8speaks
Copy link

pep8speaks commented Jan 30, 2024

Hello @BryanFauble! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 2622:89: E501 line too long (90 > 88 characters)

Line 35:89: E501 line too long (110 > 88 characters)
Line 72:89: E501 line too long (110 > 88 characters)
Line 107:89: E501 line too long (101 > 88 characters)
Line 108:89: E501 line too long (90 > 88 characters)
Line 109:89: E501 line too long (105 > 88 characters)
Line 115:89: E501 line too long (116 > 88 characters)
Line 116:89: E501 line too long (103 > 88 characters)
Line 125:89: E501 line too long (103 > 88 characters)
Line 128:89: E501 line too long (92 > 88 characters)

Line 73:89: E501 line too long (89 > 88 characters)
Line 135:89: E501 line too long (129 > 88 characters)
Line 181:89: E501 line too long (108 > 88 characters)
Line 192:89: E501 line too long (110 > 88 characters)
Line 237:89: E501 line too long (89 > 88 characters)
Line 247:89: E501 line too long (110 > 88 characters)
Line 257:89: E501 line too long (97 > 88 characters)
Line 268:89: E501 line too long (110 > 88 characters)
Line 276:89: E501 line too long (117 > 88 characters)
Line 286:89: E501 line too long (110 > 88 characters)

Line 99:89: E501 line too long (95 > 88 characters)
Line 108:89: E501 line too long (103 > 88 characters)
Line 161:89: E501 line too long (99 > 88 characters)
Line 171:89: E501 line too long (99 > 88 characters)
Line 181:89: E501 line too long (105 > 88 characters)
Line 195:89: E501 line too long (92 > 88 characters)
Line 238:89: E501 line too long (90 > 88 characters)
Line 243:89: E501 line too long (90 > 88 characters)
Line 248:89: E501 line too long (90 > 88 characters)
Line 277:89: E501 line too long (107 > 88 characters)
Line 366:89: E501 line too long (95 > 88 characters)
Line 375:89: E501 line too long (103 > 88 characters)
Line 430:89: E501 line too long (99 > 88 characters)
Line 440:89: E501 line too long (99 > 88 characters)
Line 450:89: E501 line too long (105 > 88 characters)
Line 464:89: E501 line too long (92 > 88 characters)
Line 509:89: E501 line too long (89 > 88 characters)
Line 514:89: E501 line too long (89 > 88 characters)
Line 519:89: E501 line too long (89 > 88 characters)
Line 548:89: E501 line too long (107 > 88 characters)
Line 647:89: E501 line too long (95 > 88 characters)
Line 656:89: E501 line too long (103 > 88 characters)
Line 714:89: E501 line too long (99 > 88 characters)
Line 724:89: E501 line too long (99 > 88 characters)
Line 734:89: E501 line too long (105 > 88 characters)
Line 748:89: E501 line too long (92 > 88 characters)
Line 833:89: E501 line too long (107 > 88 characters)
Line 856:89: E501 line too long (94 > 88 characters)
Line 861:89: E501 line too long (90 > 88 characters)
Line 937:89: E501 line too long (95 > 88 characters)
Line 946:89: E501 line too long (103 > 88 characters)
Line 1002:89: E501 line too long (99 > 88 characters)
Line 1012:89: E501 line too long (99 > 88 characters)
Line 1022:89: E501 line too long (105 > 88 characters)
Line 1036:89: E501 line too long (92 > 88 characters)
Line 1122:89: E501 line too long (107 > 88 characters)
Line 1189:89: E501 line too long (90 > 88 characters)
Line 1190:89: E501 line too long (93 > 88 characters)
Line 1212:89: E501 line too long (95 > 88 characters)
Line 1216:89: E501 line too long (123 > 88 characters)
Line 1220:89: E501 line too long (103 > 88 characters)
Line 1275:89: E501 line too long (99 > 88 characters)
Line 1285:89: E501 line too long (99 > 88 characters)
Line 1289:89: E501 line too long (123 > 88 characters)
Line 1294:89: E501 line too long (105 > 88 characters)
Line 1308:89: E501 line too long (92 > 88 characters)

Line 4:1: F811 redefinition of unused 'pytest' from line 1

Line 67:54: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 68:59: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 108:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 109:58: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 149:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 150:58: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 190:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 191:58: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 230:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 231:58: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 270:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 271:58: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 295:33: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 314:33: E712 comparison to True should be 'if cond is True:' or 'if cond:'

Comment last updated at 2024-01-30 23:14:52 UTC

Copy link
Contributor

@BWMac BWMac left a comment

Choose a reason for hiding this comment

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

looks great. I really like the mixin implementation. Only thing is permission issues in the demo script. I'll come back to approve once I can run it to completion

@BWMac BWMac self-requested a review January 30, 2024 20:18
Copy link
Contributor

@BWMac BWMac left a comment

Choose a reason for hiding this comment

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

@BryanFauble It works now, thanks for updating the permissions.

Copy link
Member

Choose a reason for hiding this comment

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

Just a note, Evaluation objects in Synapse have a different access control list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know. When that gets created we may need to make a mixin for that specifically than

"""Should messages that are emailed to the user be marked as
READ in Synapse? Default false."""

preferences: Optional[List[UserPreference]] = field(default_factory=list)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Not related, but I don't understand this preferences parameter. I took a look at the API and it doesn't tell you much about it either...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was messing around with this as well since it isn't explained anywhere. It let's you set arbitrary booleans on your account. For example if you get the userprofile for my account i set an example value. bfauble

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 LGTM!

@BryanFauble BryanFauble merged commit 46d25cc into develop Jan 30, 2024
29 checks passed
@BryanFauble BryanFauble deleted the SYNPY-1348-user-profile branch January 30, 2024 23:26
Copy link

sonarcloud bot commented Jan 30, 2024

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.

None yet

4 participants