共用方式為


SPRole.Update method

NOTE: This API is now obsolete.

請改用新的SPRoleDefinitionSPRoleAssignment類別,來定義角色,並將使用者指派給它們。如需詳細資訊,請參閱Changes in the Authorization Object Model。(在Windows SharePoint Services 2.0, Update方法更新資料庫角色所做的變更和維護回溯相容性。)

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
<ObsoleteAttribute("Use the SPRoleDefinition class instead")> _
Public Sub Update
'用途
Dim instance As SPRole

instance.Update()
[ObsoleteAttribute("Use the SPRoleDefinition class instead")]
public void Update()

Examples

下列程式碼範例會使用Update方法來變更的名稱和角色的描述。

Dim site As SPWeb = SPContext.Current.Web
Dim role As SPRole = site.Roles("Role_Name")

role.Description = "Description"
role.Name = "New_Name"

role.Update()
SPWeb oWebsite = SPContext.Current.Web;
SPRole oRole = oWebsite.Roles["Role_Name"];

oRole.Description = "Description";
oRole.Name = "New_Name";

oRole.Update();

請參閱

參照

SPRole class

SPRole members

Microsoft.SharePoint namespace