-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Clarify app manager method names #49648
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@nickvergessen Thoughts on the naming and logic? |
nickvergessen
approved these changes
Jan 22, 2025
c75772e
to
6e4b6d7
Compare
artonge
reviewed
Feb 11, 2025
provokateurin
approved these changes
Feb 13, 2025
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.
LGTM, just some of the commits should be squashed
The method name was really confusing Signed-off-by: Côme Chilliet <[email protected]>
…name Signed-off-by: Côme Chilliet <[email protected]>
Remove all references to installed apps where it’s about enabled apps Signed-off-by: Côme Chilliet <[email protected]>
…rUser Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
8934d58
to
f758f56
Compare
rebased and squashed some commits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Renames isInstalled -> isEnabledForAnyone, and getInstalledApps -> getEnabledApps.
There is a weird situation for apps which are enabled only for some groups of users:
For isEnabled*, one can use isEnabledForUser($app, null), to check if the app is enabled for everyone.
But for getEnabled*, there is no equivalent, as getEnabledForUser parameter is mandatory.
Because of that, in NavigationManager, isEnabledForUser is called on each app returned by getInstalledApps.
We could consider that when there is no user in session we should always exclude apps enabled only for some groups, and I think for public pages it makes sense (does it?).
But the issue is for
occ
cli tool, there there is no user in session but we do want to consider app enabled for some groups only as enabled.So basically for each getInstalledApps call, we should ask ourselves whether the list should include partially-enabled apps or not, and replace with the appropriate method call.
We may want to rename getEnabledApps with a more precise name, but getEnableAppsForAnyone is ugly, no?
We may want to add a way to get apps enabled for everyone, either as a new method or by making the parameter nullable in getEnabledAppsForUser.
Checklist