共用方式為


Grant 方法 (ObjectPermissionSet, String, Boolean, String)

授與指定的權限集給被授與者,以及在預存程序上將所擔任角色的權限集授與其他使用者的能力。

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public Sub Grant ( _
    permission As ObjectPermissionSet, _
    granteeName As String, _
    grantGrant As Boolean, _
    asRole As String _
)
'用途
Dim instance As StoredProcedure
Dim permission As ObjectPermissionSet
Dim granteeName As String
Dim grantGrant As Boolean
Dim asRole As String

instance.Grant(permission, granteeName, _
    grantGrant, asRole)
public void Grant(
    ObjectPermissionSet permission,
    string granteeName,
    bool grantGrant,
    string asRole
)
public:
virtual void Grant(
    ObjectPermissionSet^ permission, 
    String^ granteeName, 
    bool grantGrant, 
    String^ asRole
) sealed
abstract Grant : 
        permission:ObjectPermissionSet * 
        granteeName:string * 
        grantGrant:bool * 
        asRole:string -> unit 
override Grant : 
        permission:ObjectPermissionSet * 
        granteeName:string * 
        grantGrant:bool * 
        asRole:string -> unit 
public final function Grant(
    permission : ObjectPermissionSet, 
    granteeName : String, 
    grantGrant : boolean, 
    asRole : String
)

參數

  • grantGrant
    型別:System. . :: . .Boolean
    Boolean 屬性,指定被授與者是否能夠將指定的權限集授與預存程序上的其他使用者。
    如果為 True,則表示被授與者能夠將指定的權限集授與預存程序上的其他使用者。
    如果為 False,則表示被授與者無法將指定的權限集授與預存程序上的其他使用者。
  • asRole
    型別:System. . :: . .String
    String 值,指定當使用者將預存程序上指定的權限集授與其他使用者時,前者所擔任的角色。您可以針對屬於多個角色之成員的被授與者使用這個參數。

實作

IObjectPermission. . :: . .Grant(ObjectPermissionSet, String, Boolean, String)