Skip to content
Snippets Groups Projects

Create read_admin_subscription custom admin ability

Merged Ian Anderson requested to merge 507961-ia-read_admin_subscription into master
All threads resolved!

What does this MR do and why?

Related to #507961 (closed)

This MR adds the custom ability for a non-admin user to read the instance subscription details in the admin dashboard.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the feature flag.
    Feature.enable(:custom_ability_read_admin_subscription) 
  2. Create the admin role.
    admin_member_role = MemberRole.create(name: 'View subscription', description: 'View subscription', read_admin_subscription: true)
  3. Assign the member role to a user
    Users::UserMemberRole.create(member_role: admin_member_role, user: user)
  4. Log in with the user account and navigate to /admin/subscription. You should see the subscription details but not have any access to other admin functionality.
Edited by Ian Anderson

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ian Anderson marked this merge request as ready

    marked this merge request as ready

  • Ian Anderson changed the description

    changed the description

  • Author Maintainer

    @eugielimpin Do you mind taking the initial backend review here? :pray:

    Edited by Ian Anderson
  • Ian Anderson requested review from @eugielimpin

    requested review from @eugielimpin

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • 2 2
    3 3 # EE:Self Managed
    4 4 class Admin::SubscriptionsController < Admin::ApplicationController
    5 extend ::Gitlab::Utils::Override
    6
    5 7 respond_to :html
    6 8
    7 9 feature_category :plan_provisioning
    8 10 urgency :low
    11
    12 private
    13
    14 override :authenticate_admin!
    15 def authenticate_admin!
  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson mentioned in merge request !177514 (merged)

    mentioned in merge request !177514 (merged)

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Eugie Limpin resolved all threads

    resolved all threads

  • Eugie Limpin
  • Eugie Limpin
  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Eugie Limpin requested review from @eugielimpin

    requested review from @eugielimpin

  • Eugie Limpin approved this merge request

    approved this merge request

  • Eugie Limpin resolved all threads

    resolved all threads

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • Eugie Limpin requested review from @SamWord

    requested review from @SamWord

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-cng: :white_check_mark: test report for 6228b59b

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Create      | 143    | 0      | 19      | 0     | 162   | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Govern      | 84     | 0      | 10      | 0     | 94    | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Package     | 29     | 0      | 15      | 0     | 44    | ✅     |
    | Verify      | 53     | 0      | 19      | 0     | 72    | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Fulfillment | 2      | 0      | 7       | 0     | 9     | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 448    | 0      | 123     | 0     | 571   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-gdk: :white_check_mark: test report for 6228b59b

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Plan        | 164    | 0      | 16      | 0     | 180   | ✅     |
    | Create      | 276    | 0      | 40      | 0     | 316   | ✅     |
    | Data Stores | 66     | 0      | 20      | 0     | 86    | ✅     |
    | Monitor     | 16     | 0      | 24      | 0     | 40    | ✅     |
    | Verify      | 104    | 0      | 40      | 2     | 144   | ✅     |
    | Package     | 48     | 0      | 28      | 0     | 76    | ✅     |
    | Growth      | 0      | 0      | 4       | 0     | 4     | ➖     |
    | Govern      | 158    | 0      | 26      | 0     | 184   | ✅     |
    | Configure   | 0      | 0      | 6       | 0     | 6     | ➖     |
    | Fulfillment | 4      | 0      | 14      | 0     | 18    | ✅     |
    | Analytics   | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Manage      | 2      | 0      | 18      | 0     | 20    | ✅     |
    | Secure      | 8      | 0      | 6       | 0     | 14    | ✅     |
    | Release     | 10     | 0      | 2       | 0     | 12    | ✅     |
    | ModelOps    | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Ai-powered  | 0      | 0      | 4       | 0     | 4     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 860    | 0      | 250     | 2     | 1110  | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    Edited by ****
  • Ian Anderson added 1 commit

    added 1 commit

    Compare with previous version

  • Ian Anderson reset approvals from @eugielimpin by pushing to the branch

    reset approvals from @eugielimpin by pushing to the branch

  • Ian Anderson added 1 commit

    added 1 commit

    • 6e64213f - Add ability to override authorization when enforcing admin authentication

    Compare with previous version

  • Author Maintainer

    @tachyons-gitlab are you available to review changes to app/controllers/concerns/enforces_admin_authentication.rb for groupauthentication :pray:

  • requested review from @tachyons-gitlab

  • Ian Anderson added 1 commit

    added 1 commit

    • 5b1245b5 - Add ability to override authorization when enforcing admin authentication

    Compare with previous version

  • mentioned in task #514142 (closed)

  • Aboobacker MK
  • Eugie Limpin mentioned in commit 12c6d88c

    mentioned in commit 12c6d88c

  • mentioned in issue #508782 (closed)

  • mo khan mentioned in commit fdb33d7d

    mentioned in commit fdb33d7d

  • Sam Word
  • Sam Word
  • Isaac Durham
  • @imand3r , just one small suggestion from me!

  • Ian Anderson added 1 commit

    added 1 commit

    • fef8d524 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Aboobacker MK approved this merge request

    approved this merge request

  • Ian Anderson added 2150 commits

    added 2150 commits

    • fef8d524...3f8ec3d5 - 2145 commits from branch master
    • 48e0372f - Create read_admin_subscription custom admin ability
    • 4c624371 - Add feature flag
    • daaed204 - Apply suggestions
    • bc553686 - Add ability to override authorization when enforcing admin authentication
    • 4767a403 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Ian Anderson reset approvals from @tachyons-gitlab by pushing to the branch

    reset approvals from @tachyons-gitlab by pushing to the branch

  • Ian Anderson added 1 commit

    added 1 commit

    • 9bb47548 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Sam Word approved this merge request

    approved this merge request

  • Author Maintainer

    @tachyons-gitlab Do you mind re-approving? I had to resolve a merge conflict which reset your approval.

  • Ian Anderson added 214 commits

    added 214 commits

    • 9bb47548...5fdd0a5d - 209 commits from branch master
    • 5216e8f0 - Create read_admin_subscription custom admin ability
    • 41fa04a1 - Add feature flag
    • 35058792 - Apply suggestions
    • 563231d6 - Add ability to override authorization when enforcing admin authentication
    • 6228b59b - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Ian Anderson reset approvals from @SamWord by pushing to the branch

    reset approvals from @SamWord by pushing to the branch

  • Ian Anderson requested review from @eugielimpin

    requested review from @eugielimpin

  • Eugie Limpin approved this merge request

    approved this merge request

  • Eugie Limpin resolved all threads

    resolved all threads

  • Eugie Limpin resolved all threads

    resolved all threads

  • requested review from @tachyons-gitlab

  • Eugie Limpin requested review from @SamWord

    requested review from @SamWord

  • Aboobacker MK approved this merge request

    approved this merge request

  • Eugie Limpin mentioned in commit 2fa8a880

    mentioned in commit 2fa8a880

  • Sam Word approved this merge request

    approved this merge request

  • Sam Word enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • merged

  • Sam Word mentioned in commit da673cff

    mentioned in commit da673cff

  • added workflowstaging label and removed workflowcanary label

  • Eugie Limpin mentioned in merge request !179794 (merged)

    mentioned in merge request !179794 (merged)

  • Please register or sign in to reply
    Loading