UserPropertiesDeleteProperty Method (ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Deletes a custom Content Studio User property.

Namespace: ContentStudio.Security
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public void DeleteProperty(
	ConnectionId connectionId,
	SessionId sessionId,
	string identifier,
	TrusteeUserIdentifiers idType,
	string propertyName
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
identifier
Type: SystemString
An identifier to a user.
idType
Type: ContentStudio.SecurityTrusteeUserIdentifiers
The type of identifier entered in the Identifier parameter.
propertyName
Type: SystemString
The name of the property to delete. The property must have the form Application.Property. If you try to delete properties of the system application or if propertyName does not exist an exception is thrown.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database. The following numbered exceptions are common:
  • 1001 - The session is invalid
  • 1002 - Permission denied
  • 1023 - The property does not exist
  • 1024 - The application does not exist
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

A user can always work with her own data. For other accounts the caller must have the GlobalGroupAdmin user right.
Remarks

All property an application names are case sensitive.
Examples

The following code shows how to delete a property named Data1 in the application MyApp for the calling user. Since DeleteProperty generates an error when called on a non-existing property this code sample first examines whether the property exists or not before deleting it.

try
{
   UserProperty upo = new UserProperties();
   if(upo.ExistsProperty(CS_ConnectionId, CS_UserSessionId, "MyApp", "Data1"))
   {
      upo.DeleteProperty(CS_ConnectionId, CS_UserSessionId, String.Empty, Trustee.UserIdentifiers.None, "MyApp.Data1");
   }
}
catch (Exception ex)
{
   Response.Write(Server.HtmlEncode(ex.Message));
}
See Also

Reference