Skip to content

Commit b4cb274

Browse files
Revise managed navigation documentation for SharePoint (#10792)
* Revise managed navigation documentation for SharePoint Updated the metadata and content of the managed navigation documentation, including the date and a note about the feature's support in Classic vs. Modern SharePoint. * Revise UDF external data source documentation Updated metadata and added important note about Excel Services support. * Revise user profiles documentation in SharePoint Updated the documentation for working with user profiles in SharePoint, including changes to the title, description, and date. * Doc updated for links * Revise item-level security documentation for SharePoint Updated the date and added important notes regarding BCS and NTLM configurations. * Revise CloseWorkbook method usage for async calls Updated the article to reflect the deprecation of SharePoint Excel Services and recommended alternatives. Adjusted the last modified date and ensured the content is current. * Revise article with links and content Updated the article to reflect the deprecation of JSLink and client-side rendering in modern SharePoint experiences, and provided guidance on using SharePoint Framework (SPFx) Field Customizer extensions instead. * docs: clean up formatting on four general-development articles - revert `ms.date` to original publication date; rendering engine shows last modified date dynamically from git history - collapse consecutive blank lines into single blank lines - remove legacy `<a name="...">` anchor tags - normalize ordered list markers to `1.` so the rendering engine auto-numbers - remove blank lines between adjacent bullet items - reformat csharp code blocks to consistent two-space indentation --------- Co-authored-by: Andrew Connell <me@andrewconnell.com>
1 parent 6757a60 commit b4cb274

7 files changed

Lines changed: 526 additions & 1058 deletions

docs/general-development/how-to-access-an-external-data-source-from-a-udf.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Access an external data source from a UDF
33
description: This example shows how to access an external database from a user-defined function (UDF).
4-
ms.date: 09/25/2017
4+
ms.date: 04/22/2026
55
keywords: how to,howdoi,howto,UDF
66
f1_keywords:
77
- how to,howdoi,howto,UDF
@@ -12,6 +12,9 @@ ms.localizationpriority: medium
1212

1313
# Access an external data source from a UDF
1414

15+
> [!IMPORTANT]
16+
> Excel Services is a SharePoint Server (on-premises) feature. Excel Services is not supported in SharePoint Online. Use [Excel Online in Microsoft 365](https://www.microsoft.com/microsoft-365) instead.
17+
1518
This example shows how to access an external database from a user-defined function (UDF).
1619

1720

@@ -97,7 +100,7 @@ namespace DatabaseAccessUdfTest1
97100
```
98101

99102

100-
```VB.net
103+
```vb
101104

102105
Imports System
103106
Imports System.Collections.Generic
Lines changed: 39 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
11
---
22
title: Configure item-level security in SharePoint
33
description: Learn how to configure item level security when crawling external data with BCS indexing connectors in SharePoint.
4-
ms.date: 09/25/2017
4+
ms.date: 04/24/2017
55
ms.assetid: ffd730f2-e7b7-4707-b677-d073da7df7d7
66
ms.localizationpriority: medium
77
---
88

9-
109
# Configure item-level security in SharePoint
1110

1211
Learn how to configure item level security when crawling external data with BCS indexing connectors in SharePoint.
1312

13+
> [!IMPORTANT]
14+
> Business Connectivity Services (BCS) and NTLM-based configurations are primarily supported in SharePoint Server. These approaches are not commonly used in SharePoint Online, where modern authentication and Microsoft Graph-based connectors are preferred.
15+
1416
## External systems with NTLM authentication
15-
<a name="ItemLevelSecurity_NTLMAuth"> </a>
1617

1718
For external systems that support NTLM authentication, the security descriptor can be obtained for each instance of the external content type at crawl time and stored in the content index. During query time, the security descriptor of the user who is submitting the search query is compared to the stored security descriptor to determine whether the user has access to the item. This is the fastest way to perform security trimming on the result set. The metadata model for the external system must indicate where the security descriptor can be found as an external content type field or method.
18-
19-
20-
2119

2220
### External content type field
23-
<a name="ItemLevelSecurity_ExtTypeField"> </a>
2421

25-
Microsoft SharePoint stores the security descriptor if the field of the external content type that contains the descriptor is marked by using the **WindowsSecurityDescriptorField** property, as shown in the following example.
26-
27-
28-
22+
Microsoft SharePoint stores the security descriptor if the field of the external content type that contains the descriptor is marked by using the `WindowsSecurityDescriptorField` property, as shown in the following example.
2923

3024
```XML
31-
32-
<Method Name="Item SpecificFinder ">
25+
<Method Name="Item SpecificFinder">
3326
<Properties>
34-
<Property Name="RdbCommandType" Type="System.Data.CommandType, System.Data,
35-
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">Text</Property>
36-
<Property Name="RdbCommandText" Type="System.String">SELECT [Identifier] ,
37-
[SecurityDescriptor] FROM [Test].[dbo].[Items] WHERE [Identifier] = @Identifier</Property>
27+
<Property Name="RdbCommandType" Type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">Text</Property>
28+
<Property Name="RdbCommandText" Type="System.String">SELECT [Identifier], [SecurityDescriptor] FROM [Test].[dbo].[Items] WHERE [Identifier] = @Identifier</Property>
3829
<Property Name="BackEndObjectType" Type="System.String">SqlServerTable</Property>
3930
<Property Name="BackEndObject" Type="System.String">Items</Property>
4031
<Property Name="Schema" Type="System.String">dbo</Property>
@@ -44,14 +35,14 @@ Microsoft SharePoint stores the security descriptor if the field of the external
4435
<TypeDescriptor TypeName="System.Int32" IdentifierName="Identifier" Name="Identifier" />
4536
</Parameter>
4637
<Parameter Direction="Return" Name="BaseItemsRead Item">
47-
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0,
38+
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0,
4839
Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="BaseItemsRead Item">
4940
<TypeDescriptors>
50-
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0,
41+
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0,
5142
Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="BaseItemsRead ItemElement">
5243
<TypeDescriptors>
5344
<TypeDescriptor TypeName="System.Int32" IdentifierName="Identifier" Name="Identifier"/>
54-
<TypeDescriptor TypeName="System.Byte[], mscorlib, Version=2.0.0.0,
45+
<TypeDescriptor TypeName="System.Byte[], mscorlib, Version=2.0.0.0,
5546
Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="SecurityDescriptor">
5647
<TypeDescriptors>
5748
<TypeDescriptor TypeName="System.Byte" Name="SecurityDescriptorElement" />
@@ -64,12 +55,10 @@ Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Secu
6455
</Parameter>
6556
</Parameters>
6657
<MethodInstances>
67-
<MethodInstance Type="SpecificFinder" ReturnParameterName="BaseItemsRead Item"
68-
ReturnTypeDescriptorName="BaseItemsRead ItemElement" Name="BaseItemsRead Item"
69-
DefaultDisplayName="ReadSecurity">
58+
<MethodInstance Type="SpecificFinder" ReturnParameterName="BaseItemsRead Item" ReturnTypeDescriptorName="BaseItemsRead ItemElement" Name="BaseItemsRead Item" DefaultDisplayName="ReadSecurity">
7059
<Properties>
7160
<Property Name="WindowsSecurityDescriptorField" Type="System.String">
72-
SecurityDescriptor
61+
SecurityDescriptor
7362
</Property>
7463
</Properties>
7564
</MethodInstance>
@@ -78,48 +67,31 @@ DefaultDisplayName="ReadSecurity">
7867
```
7968

8069
> [!NOTE]
81-
> ems are limited to a specific size, which access control lists (ACL) can easily exceed. Therefore, the Search connector framework ignores requests to cache items if they contain a security descriptor field.
82-
83-
84-
85-
70+
> Items are limited to a specific size, which access control lists (ACL) can easily exceed. Therefore, the Search connector framework ignores requests to cache items if they contain a security descriptor field.
8671
8772
### External content type method
88-
<a name="ItemLevelSecurity_ExtTypeMethod"> </a>
8973

90-
If you have a method defined in the metadata model that returns the security descriptor for an item based on its identifier, you can use the **BinarySecurityDescriptorAccessor** method stereotype, as shown in the following example.
91-
92-
93-
74+
If you have a method defined in the metadata model that returns the security descriptor for an item based on its identifier, you can use the `BinarySecurityDescriptorAccessor` method stereotype, as shown in the following example.
9475

9576
```XML
96-
9777
<Method Name="GetItemSecurity" LobName="GetItemSecurity">
9878
<Parameters>
9979
<Parameter Name="itemId" Direction="In">
100-
<TypeDescriptor Name="itemId" TypeName="System.Int32, mscorlib,
101-
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
102-
IdentifierEntityNamespace="MS.Internal.Test.Automation.Search.Scater"
103-
IdentifierEntityName="Item" IdentifierName="ItemId" />
80+
<TypeDescriptor Name="itemId" TypeName="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IdentifierEntityNamespace="MS.Internal.Test.Automation.Search.Scater" IdentifierEntityName="Item" IdentifierName="ItemId" />
10481
</Parameter>
10582
<Parameter Name="Return" Direction="Return">
106-
<TypeDescriptor Name="SecurityDescriptor" TypeName="System.Byte[],
107-
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
108-
IsCollection="true">
83+
<TypeDescriptor Name="SecurityDescriptor" TypeName="System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true">
10984
<TypeDescriptors>
110-
<TypeDescriptor Name="Item" TypeName="System.Byte, mscorlib,
111-
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
85+
<TypeDescriptor Name="Item" TypeName="System.Byte, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
11286
</TypeDescriptors>
11387
</TypeDescriptor>
11488
</Parameter>
11589
</Parameters>
11690
<MethodInstances>
117-
<MethodInstance Name="GetItemSecurity_Instance" Type="BinarySecurityDescriptorAccessor"
118-
ReturnParameterName="Return" ReturnTypeDescriptorName="SecurityDescriptor"
119-
ReturnTypeDescriptorLevel="0">
91+
<MethodInstance Name="GetItemSecurity_Instance" Type="BinarySecurityDescriptorAccessor" ReturnParameterName="Return" ReturnTypeDescriptorName="SecurityDescriptor" ReturnTypeDescriptorLevel="0">
12092
<Properties>
12193
<Property Name="WindowsSecurityDescriptorField" Type="System.String">
122-
SecurityDescriptor
94+
SecurityDescriptor
12395
</Property>
12496
</Properties>
12597
<AccessControlList>
@@ -133,31 +105,16 @@ ReturnTypeDescriptorLevel="0">
133105
```
134106

135107
The following code is the method signature for the method that is specified in the previous example.
136-
137-
138-
139-
140-
141108

142109
```csharp
143-
144-
Public static Byte[]GetItemSecurity (string id)
145-
{
146-
147-
}
110+
Public static Byte[]GetItemSecurity (string id) { }
148111
```
149112

150-
151113
## External systems with authentication schemes that can be mapped to NTLM authentication
152-
<a name="ItemLevelSecurity_MappedToNTLM"> </a>
153114

154-
If the external system does not support NTLM authentication, but the external system users can be mapped to Windows users by using a mapping table, you can use the approach described in the previous two code examples to provide item level security. For this to work, the web service or Windows Communication Foundation (WCF) service exposed by the external system must include a method that converts the external system users to Windows users internally, and then returns a Windows security descriptor for each URL. The following example shows how you could code this method.
155-
156-
157-
115+
If the external system does not support NTLM authentication, but the external system users can be mapped to Windows users by using a mapping table, you can use the approach described in the previous two code examples to provide item level security. For this to work, the web service or Windows Communication Foundation (WCF) service exposed by the external system must include a method that converts the external system users to Windows users internally, and then returns a Windows security descriptor for each URL. The following example shows how you could code this method.
158116

159117
```csharp
160-
161118
/// Returns the security descriptor for a user.
162119
/// </summary>
163120
/// <param name="domain"></param>
@@ -166,40 +123,27 @@ If the external system does not support NTLM authentication, but the external sy
166123
167124
private Byte[] GetSecurityDescriptor(string domain, string username)
168125
{
169-
NTAccount acc = new NTAccount(domain, username);
170-
SecurityIdentifier sid = (SecurityIdentifier)acc.Translate(typeof(SecurityIdentifier));
171-
CommonSecurityDescriptor sd = new CommonSecurityDescriptor(false, false, ControlFlags.None,
172-
sid, null, null, null);
173-
sd.SetDiscretionaryAclProtection(true, false);
174-
175-
//Deny access to all users.
176-
SecurityIdentifier everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
177-
sd.DiscretionaryAcl.RemoveAccess(AccessControlType.Allow, everyone,
178-
unchecked((int)0xffffffffL), InheritanceFlags.None, PropagationFlags.None);
126+
NTAccount acc = new NTAccount(domain, username);
127+
SecurityIdentifier sid = (SecurityIdentifier)acc.Translate(typeof(SecurityIdentifier));
128+
CommonSecurityDescriptor sd = new CommonSecurityDescriptor(false, false, ControlFlags.None, sid, null, null, null);
129+
sd.SetDiscretionaryAclProtection(true, false);
130+
131+
//Deny access to all users.
132+
SecurityIdentifier everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
133+
sd.DiscretionaryAcl.RemoveAccess(AccessControlType.Allow, everyone, unchecked((int)0xffffffffL), InheritanceFlags.None, PropagationFlags.None);
179134

180-
//Grant full access to a specified user.
181-
sd.DiscretionaryAcl.AddAccess(AccessControlType.Allow, sid,
135+
//Grant full access to a specified user.
136+
sd.DiscretionaryAcl.AddAccess(AccessControlType.Allow, sid,
182137
unchecked((int)0xffffffffL), InheritanceFlags.None, PropagationFlags.None);
183-
184-
byte[] secDes = new Byte[sd.BinaryLength];
185-
sd.GetBinaryForm(secDes, 0);
186138

187-
return secDes;
139+
byte[] secDes = new Byte[sd.BinaryLength];
140+
sd.GetBinaryForm(secDes, 0);
141+
142+
return secDes;
188143
}
189144
```
190145

191-
192146
## See also
193-
<a name="SP15Itemlevelsec_addlresources"> </a>
194-
195-
196-
- [Search connector framework in SharePoint](search-connector-framework-in-sharepoint.md)
197-
198-
199-
- [Implementing a BinarySecurityDescriptorAccessor](https://msdn.microsoft.com/library/6cf70490-dd3c-49cd-bb13-ed33e938435d%28Office.15%29.aspx)
200-
201-
202-
- [Enhancing the BDC model file for Search in SharePoint](enhancing-the-bdc-model-file-for-search-in-sharepoint.md)
203-
204-
205-
147+
- [Search connector framework in SharePoint](search-connector-framework-in-sharepoint.md)
148+
- [Implementing a BinarySecurityDescriptorAccessor](/previous-versions/office/developer/sharepoint-2010/ff464369(v=office.14))
149+
- [Enhancing the BDC model file for Search in SharePoint](enhancing-the-bdc-model-file-for-search-in-sharepoint.md)

0 commit comments

Comments
 (0)