# Assign users as page or content item owners

When you create a content item or a page in Sitefinity CMS, you (the user performing the operation) are associated as the owner of the newly created item. You can change the owner of a page but you cannot change the owner of a content item in Sitefinity CMS backend. For more information about how to change the owner of a page, see [Share a link to a page to unauthorized users](https://www.progress.com/documentation/sitefinity-cms/share-a-link-to-a-page-to-anonymous-users).

In this article, you learn how to change the owner of a page and of a content item programmatically and associate a new user as an owner.

> info **NOTE**: When changing the owner of a content item or a page, the permissions for that resource are not modified. If a user is not able to view or edit a resource due to permission restrictions, associating this user as an owner does not elevate his privileges.

## Associate a user as an owner of a page

To change the owner of a page programmatically, use the following example:

```C#
using System;
using System.Linq;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Security;

namespace SitefinityWebApp
{
    public class AssignPageOwner
    {
        public void ChangePageOwner(Guid pageId, Guid userId)
        {
            var userManager = UserManager.GetManager();
            var newOwner = userManager.GetUsers().FirstOrDefault(x => x.Id == userId);

            var pageManager = PageManager.GetManager();
            var page = pageManager.GetPageNodes().FirstOrDefault(x => x.Id == pageId);

            if (page != null && newOwner != null)
            {
                page.GetPageData().Owner = newOwner.Id;
                page.Owner = newOwner.Id;

                pageManager.SaveChanges();
            }
        }
    }
}
```

In the code above, you get the following:

* Page node of the page you want to modify
* The user you want to associate the page with

Next, you associate the `ID` of this user with the `Owner` property of the page node and the page data. To get the page data, you call the `GetPageData` method of the page node. As a result, after saving the changes, the newly associated user is the owner of the page.

## Associate a user as an owner of a content item

The following example demonstrates how to change the owner of a content item:

```C#
using System;
using System.Linq;
using Telerik.Sitefinity.Modules.News;
using Telerik.Sitefinity.Security;

namespace SitefinityWebApp
{
    public class AssignContentOwner
    {
        public void ChangeNewsItemOwner(Guid newsItemId, Guid userId)
        {
            var newsManager = NewsManager.GetManager();
            var newsItem = newsManager.GetNewsItems().FirstOrDefault(x => x.Id == newsItemId);

            var userManager = UserManager.GetManager();
            var newOwner = userManager.GetUsers().FirstOrDefault(x => x.Id == userId);

            if (newsItem != null && newOwner != null)
            {
                newsItem.Owner = newOwner.Id;
                newsManager.SaveChanges();
            }
        }
    }
}
```

In the code above, you get the following:

* Content item that you want to modify
* The user you want to associate the content item with

Next, you associate the `ID` of this user with the `Owner` property of the content item. As a result, after saving the changes, the newly associated user is the owner of the content item.
