> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Locking Megaport Services

> This help topic describes how to lock Ports and other services to prevent modification and deletion.

export const Video = ({url, text, duration, description}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Video -';
  if (typeof url !== 'string') {
    url = String(url);
  }
  if (typeof text !== 'string') {
    text = String(text);
  }
  if (!url || url === 'undefined') {
    console.error(`${errorPrefix} the \`url\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (!text || text === 'undefined') {
    console.error(`${errorPrefix} the \`text\` property is required — rendering an empty string instead`);
    return <></>;
  }
  const youtubeIconMask = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath d='M549.7 124.1c-6.3-23.7-24.8-42.3-48.3-48.6C458.8 64 288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zM232 336V176l142.7 80z'/%3E%3C/svg%3E\")";
  return <div className="video-callout">
      <div className="callout my-4 flex gap-3 overflow-hidden rounded-2xl border px-5 py-4">
        <div className="mt-0.5 w-4 shrink-0" data-component-part="callout-icon">
          <svg aria-hidden="true" className="size-4 shrink-0" style={{
    WebkitMaskImage: youtubeIconMask,
    maskImage: youtubeIconMask,
    WebkitMaskRepeat: 'no-repeat',
    maskRepeat: 'no-repeat',
    WebkitMaskPosition: 'center',
    maskPosition: 'center',
    backgroundColor: '#0284c7'
  }} />
        </div>
        <div className="min-w-0 w-full text-sm" data-component-part="callout-content">
          <strong>
            Video:{' '}
            <a href={url} target="_blank" rel="noopener noreferrer">
              {text}
              <span className="sr-only"> (opens in a new tab)</span>
            </a>
          </strong>
          {}
          {duration && <> ({duration})</>}
          {}
          {description && <p className="mt-1 mb-0 text-xs text-gray-500 dark:text-gray-400">
              {description}
            </p>}
        </div>
      </div>
    </div>;
};

export const Image = ({src, alt = '', caption, width, height, shadow}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Image -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  const img = <img className={['mega-image-style', shadow ? 'shadow' : ''].join(' ')} src={src} alt={alt} width={width} height={height} style={{
    display: 'block'
  }} />;
  return caption ? <figure>
      {img}
      <figcaption style={{
    textAlign: 'center',
    width
  }}>{caption}</figcaption>
    </figure> : img;
};

export const Link = ({href, children}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Link -';
  if (typeof href !== 'string') {
    href = String(href);
  }
  if (!href || href === 'undefined') {
    console.error(`${errorPrefix} the \`href\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (href.includes('{') || href.toUpperCase().includes('%7B')) {
    console.error(`${errorPrefix} could not resolve a variable in href "${href}" — rendering an empty string instead`);
    return <></>;
  }
  const isExternal = (/^https?:\/\//).test(href);
  return <a href={href} className="link" target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noreferrer' : undefined}>
      {children ?? href}
      {isExternal && <span className="sr-only"> (opens in a new tab)</span>}
    </a>;
};

If you are a *Company Admin* user, you can lock Ports, Megaport Cloud Routers (MCRs), Megaport Virtual Edges (MVEs), Internet Exchanges (IXs) and other Megaport services to prevent modification or deletion. For information about user roles such as *Company Admin*, see [Managing User Roles](/portal-admin/user-management/roles).

You can lock a service while it is still provisioning; the service does not need to be *Live*. For example, you can lock a configured Port that is awaiting its Cross Connect. Unlocking is available regardless of provisioning status.

<Note>
  Locking is not available for services that are in your cart, or that have been cancelled, decommissioned, or have failed. When locking is unavailable, the padlock icon is grayed out.
</Note>

<Video url="https://youtu.be/8HtxefJgzG0" text="How to Lock Services" duration="2:00" description="This video shows how to lock and unlock Ports and MCRs in the Megaport Portal to prevent accidental changes or deletions." />

**To lock a Port service**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page.
2. Click the padlock icon next to the service you want to lock.

   **Example 1:** A Port (DRNYC1) has a VXC attached (Singapore SG2). The padlock icons on the Port and VXC indicate that the Port's provisioning status is *Live*, traffic is traversing across the VXC, and both services can be locked.

   <Image src="/images/portal-admin/port-vxc.png" alt="Unlocked Port and VXC" shadow={true} width={550} />

   **Example 2:** The same Port and VXC are shown; however, even though the Port is unlocked, the VXC remains locked. When a single VXC is locked, it is not possible to delete the VXC, the Port, or any attached services (as indicated by the grayed out Delete Port icons). To delete the Port, a *Company Admin* must unlock the VXC first.

   <Image src="/images/portal-admin/dimmed-delete-icon.png" alt="Locked VXC" shadow={true} width={550} />

**To lock an Internet Exchange or Virtual Cross Connect service**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page.
2. Click the padlock icon next to the Megaport service you would like to lock.
   <Image src="/images/portal-admin/ix-padlock.png" alt="Padlock Icon" shadow={true} width={500} />

## User role permissions

If an Admin user below *Company Admin* (such as a *Technical Admin* or *Finance Admin* user) has permission to make changes, they still won't be able to delete or edit any locked Megaport service. Only a *Company Admin* can unlock the service. Other users receive the following warning if they attempt to make a change.

<Image src="/images/portal-admin/locked-service.png" alt="Company Admin Warning" shadow={true} width={500} />

Users at access levels below *Company Admin* can perform the following tasks:

* **Add VXCs/IX services to locked Megaport services** -- Additional services will not be set to Locked status. By default, they will be set to Unlocked.

* **View details of locked Megaport services** -- If a service is locked, its status can be viewed on the Details page.
