Skip to content

allow domain admins to add ldap users - #13952

Draft
DaanHoogland wants to merge 1 commit into
mainfrom
ghi3687-domain-admin-ldap-access
Draft

DaanHoogland wants to merge 1 commit into
mainfrom
ghi3687-domain-admin-ldap-access

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #3687

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@DaanHoogland DaanHoogland added this to the 4.24.0 milestone Aug 22, 2026
@codecov

codecov Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.73%. Comparing base (5e5ae0c) to head (61f3215).
⚠️ Report is 91 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13952   +/-   ##
=========================================
  Coverage     19.72%   19.73%           
- Complexity    19941    19945    +4     
=========================================
  Files          6371     6371           
  Lines        575738   575738           
  Branches      70471    70471           
=========================================
+ Hits         113582   113608   +26     
+ Misses       449810   449780   -30     
- Partials      12346    12350    +4     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 21.01% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 24.60%
Branch coverage 18.81%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

@DaanHoogland
DaanHoogland force-pushed the ghi3687-domain-admin-ldap-access branch from 6d74ade to 61f3215 Compare August 22, 2026 21:25
@sonarqubecloud

Copy link
Copy Markdown

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19160

@kiranchavala kiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@DaanHoogland

When Ldap configuration is linked to a domain , the add LDAP account button is not visible in the UI when domain admin is logged in

[root@ref-trl-12338-k-Mol8-kiran-chavala-mgmt1 ~]# cmk list ldapconfigurations listall=true
Loaded in-built API cache. Failed to read API cache, please run 'sync'.
{
  "LdapConfiguration": [
    {
      "domainid": "15151f02-0d6a-401c-bc9f-35c31712bee1",
      "hostname": "10.0.33.32",
      "id": "edd0c804-4b82-4e4e-b500-2725325f8d52",
      "port": 389
    }
  ],
  "count": 1
}
Image

When the ldap configuration is not linked to any domain , then the add LDAP account is visible in the UI when domain admin is logged in

[root@ref-trl-12338-k-Mol8-kiran-chavala-mgmt1 ~]# cmk list ldapconfigurations listall=true
Loaded in-built API cache. Failed to read API cache, please run 'sync'.
{
  "LdapConfiguration": [
    {
      "hostname": "10.0.33.32",
      "id": "7137bdff-db71-4495-968f-58476ddf68d3",
      "port": 389
    }
  ],
  "count": 1
}
Image

@kiranchavala

Copy link
Copy Markdown
Member

@DaanHoogland AI suggestion

The chain

The button's only gate is store.isLdapEnabled (ui/src/config/section/account.js:119-121), and that flag is computed in ui/src/store/modules/user.js:493-495:

getAPI('listLdapConfigurations').then(response => {
  const ldapEnable = (response.ldapconfigurationresponse.count > 0)
  commit('SET_LDAP', ldapEnable)
})

Called with no parameters — so no domainid, and listall defaults to false. That lands in LdapConfigurationDaoImpl.getSearchCriteria() (lines 83-97):

} else if (domainId != null) {   // not our case
} else if (listAll) {            // not our case
} else {
    sc = listGlobalConfigurationsSearch.create();   // ← this one
}

and listGlobalConfigurationsSearch hard-filters on domain_id IS NULL (line 47):

listGlobalConfigurationsSearch.and("domain_id", ...getDomainId(), SearchCriteria.Op.NULL);

So a configuration linked to a domain has domain_id set, is excluded, count = 0, isLdapEnabled = false, and the "Add LDAP Account" action is hidden. Note this is role-independent — it hides the button for root admin too, not just domain admins.

@DaanHoogland
DaanHoogland marked this pull request as draft September 9, 2026 10:32
@DaanHoogland DaanHoogland moved this from Ready to conflict/waiting in CloudStack Testing Sep 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: conflict/waiting

Development

Successfully merging this pull request may close these issues.

Domain admins not able to add LDAP users

3 participants