-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(authz): introduce an owner relationship when creating an entity #1151
Conversation
Test Results 57 files + 33 57 suites +33 1m 21s ⏱️ +45s Results for commit 70e5d5e. ± Comparison against base commit 0023f9f. This pull request removes 12 and adds 641 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
644ff7a
to
531d0a5
Compare
FROM temporal_entity_attribute | ||
WHERE entity_id IN (select entity_id from entities_more_than_one_admin) | ||
GROUP BY entity_id | ||
), entities_oldest_with_sub AS ( |
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.
entities_with_oldest_sub
not entities_oldest_with_sub
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.
hmm, I am really looking for the oldest sub of each entity
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.
ah indeed, misread the comment
) l on true | ||
where tea.entity_id = entities_with_oldest_date.entity_id | ||
and tea.created_at = entities_with_oldest_date.created_at | ||
) |
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.
here why did you use on true
in the inner join ?
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.
indeed, it's not needed here since sub
cannot be null
@@ -177,21 +179,21 @@ class EnabledAuthorizationServiceTests { | |||
eq(Some(subjectUuid)), | |||
eq(entityId01), | |||
emptyList(), | |||
listOf(AccessRight.R_CAN_ADMIN) | |||
listOf(R_IS_OWNER, R_CAN_ADMIN) | |||
) | |||
} | |||
} | |||
|
|||
@Test | |||
fun `it should create admin link for a set of entities`() = runTest { |
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 name of the method should be renamed too : it should create creator link for a set of entities
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.
and even it should create owner link ...
@@ -421,4 +423,92 @@ class EnabledAuthorizationServiceTests { | |||
) | |||
} | |||
} | |||
|
|||
@Test | |||
fun `it should returned serialized access control entities with other rigths if user is owner`() = runTest { |
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 name of the method : it should return
and not it should returned
6235e03
to
70e5d5e
Compare
Quality Gate passedIssues Measures |
No description provided.