Skip to content

enterprise admin device and account lock/unlock actions #204

Merged
adeshmukh-ks merged 5 commits into
device-admin-commandsfrom
device-admin-commands-int
Jul 2, 2026
Merged

enterprise admin device and account lock/unlock actions #204
adeshmukh-ks merged 5 commits into
device-admin-commandsfrom
device-admin-commands-int

Conversation

@mtyagi-ks

Copy link
Copy Markdown
Contributor

Summary

  • Adds enterprise admin device actions: lock, unlock, account-lock, and account-unlock via device-admin-action, aligned with Commander.
  • Implements SDK helpers (lock_admin_user_devices, unlock_admin_user_devices, account_lock_admin_user_devices, account_unlock_admin_user_devices) using the shared _resolve_devices path (exact name / numeric ID, duplicate and ambiguous-name handling).
  • Adds unit tests and SDK examples for the new admin actions.
  • Fixes device-admin-list help and SDK error text: replace incorrect ei --users with enterprise-info user.

@mtyagi-ks mtyagi-ks changed the title Add enterprise admin device and account lock/unlock actions enterprise admin device and account lock/unlock actions Jun 30, 2026
@adeshmukh-ks adeshmukh-ks requested a review from sali-ks June 30, 2026 06:04
URL_DEVICE_ADMIN_ACTION = 'dm/device_admin_action'

DEVICE_FEATURE_UNAVAILABLE_MESSAGE = (
'This feature is not available on this server yet. It will be available soon.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change this to "not available in production yet", server would cause confusion amongst users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed

enterprise_user_ids: List[int],
) -> List[int]:
"""Return enterprise user IDs known to enterprise data; warn when IDs are not found."""
assert context.enterprise_data is not None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't user assert as it does not give a meaningful message, use base.is_enterprise_admin check which is there in other enterprise commands

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed

@adeshmukh-ks adeshmukh-ks merged commit 7a826f2 into device-admin-commands Jul 2, 2026
2 checks passed
@adeshmukh-ks adeshmukh-ks deleted the device-admin-commands-int branch July 2, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants