Show alert if user todos are hidden due to expired SSO session
What does this MR do and why?
Describe in detail what your merge request does and why.
Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/389379
When a user is a member of a group with SAML SSO for GitLab.com enabled, and hasn't visited a group-level page within the last 24 hours, todos related to that group may be hidden.
While this may not be the ideal long-term solution it is a clear notice to the user that they may have hidden todos and need to re-authenticate to see those todos. The listed groups are only present if the todos point to an object/target in that group hierarchy.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
How to short circuit to show the UI even when re-auth isn't necessary.
- Modify
ee/lib/gitlab/auth/group_saml/sso_enforcer.rb
and add a return oftrue
to theaccess_restricted_groups
method:# Given an array of groups or subgroups, return an array # of root groups that are access restricted for the user def self.access_restricted_groups(groups, user: nil) return [] unless groups&.any? ::Preloaders::GroupRootAncestorPreloader.new(groups, [:saml_provider]).execute root_ancestors = groups.map(&:root_ancestor).uniq root_ancestors.select do |root_ancestor| group_access_restricted?(root_ancestor, user: user, for_project: true) true # <-------- ADD THIS HERE end end
- Refresh/visit
/dashboard/todos
and the alert should appear.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.