Share via


Granting Permissions to View Published Presence States

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Logging on to an Office Communications Server using the Office Communicator client results in a set of containers being published to the server on a user's behalf. You cannot assume that a user previously logged on using the Office Communicator client. A custom application can discover the existence of previously published containers by subscribing to the containers category. If no IUccContainer category instances are received in a self-subscription, the custom client must create and publish a complete set of containers.

Granting permissions to view published category instances involves:

  1. Setting appropriate memberships to the containers to which the category instances are published. A member of a container is a subscribing user identified by an endpoint Uri.
  2. Publishing the configured containers category instances.

Assigning a subscribing user to a container amounts to giving the user access to the information contained in the default category list for the container.

Default Access Control List Containers

Container Number Container Name Default Membership Default Category

100

Public

federated

(UCCCMS_FEDERATED_ENTERPRISE)

  • workPhon1
  • icon
  • msrtcTemplate
  • all categories in 32000 container with data

200

Company

sameCompany

(UCCCMS_COMPANY)

  • freeBusy
  • note
  • capabilities
  • email1
  • title
  • company
  • photo
  • userState
  • calendarState
  • conferenceState
  • phoneState
  • aggregatedState
  • all categories in 32000 and 100 containers with data.

300

Team

Same Team

  • Location
  • extendedCalendarState
  • mobilePhone1
  • otherPhone1
  • all categories in 32000,100, and 200 containers with data.

400

Personal

Personal

  • homePhone1
  • all categories in 32000,100, 200, and 300 containers with data

32000

Blocked

Blocked

  • email1
  • DisplayName

In Unified Communications Client API, membership values are defined in the UCC_CONTAINER_MEMBERSHIP_SCOPE enumeration type. See the values provided in the parenthesis above.

The following C# code snippet illustrates how to set the access control on a container in such a way that all the users in a company (UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_COMPANY) are allowed to view data published to container 100. To work with a container, a Unified Communications Client API application must deal with both the IUccCategoryInstance and IUccContainer objects. The latter is obtainable by calling QueryInterface on the former.

In addition to changing access control on an existing well-known container, you can create a new container to refine access to user presence information. Setting the InstanceId in this example to a number such as 105 creates an entirely new container with the Id of 105. With the new container, you can choose any mix of ACE types and category instances to suite specific application needs.

Calling this sample method a second time with the same InstanceId updates the new container. To remove the container, set the publication operation type to UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_REMOVE and specify the InstanceID (container ID) to remove.

Note

If you specified an expiration type other than UCCCIET_STATIC, the container expires as specified without being explicitly removed.

Example

For information about adding, changing, or removing members of a container, see Manage ACL Container Membership.

partial class ContactManager
{
    /// <summary>
    /// Publishes an Acess Control Entry (ACE)to allow everyone in a
    /// company(enterprise)to get this user's 
    /// availability information. 
    /// ACEs are represented by container member
    /// </summary>
    private void PublishAcessControlEntryForEveryoneInSameCompany() 
    {
        //Create a publishable category instance representing the 
        //container member to be added
        IUccCategoryInstance pubInstance = 
             publicationManager.CreatePublishableCategoryInstance(
                  "containers",               // category name
                  0,                          // container Id
                  100,                        // instance Id
                  UCC_CATEGORY_INSTANCE_EXPIRE_TYPE.UCCCIET_USER,
                  0);

        //Cast the category instance into an IUccContainer object to 
        //add members to it
        IUccContainer container = pubInstance as IUccContainer;

        //Create a container member representing the ACE for all users 
        //in the company
        IUccContainerMember member = 
            publicationManager.CreateContainerMember(
                    null, 
                    UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_COMPANY);

        // Add the container member created above to the container
        container.AddMember(member);

        //Set publication operation type for the category
        pubInstance.PublicationOperation = 
                       UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_ADD;

        this.PublishCategoryInstance(pubInstance);
    }
}

See Also

Concepts

Manage ACL Container Membership
Create Contact List Subscription
Add a Contact to the Contact List
Remove a Contact from the Contact List
Granting Permissions to View Published Presence States
Presence Availability State
Sample Contact Presence Handling Class
Category and Category Instances
Publication and Subscription Objects