DSCResources/DSC_SqlDatabaseObjectPermission/DSC_SqlDatabaseObjectPermission.schema.mof

[ClassVersion("1.0.0.0"), FriendlyName("SqlDatabaseObjectPermission")]
class DSC_SqlDatabaseObjectPermission : OMI_BaseResource
{
    [Key, Description("Specifies the name of the _SQL Server_ instance to be configured.")] String InstanceName;
    [Key, Description("Specifies the name of the database where the object resides.")] String DatabaseName;
    [Key, Description("Specifies the name of the schema for the database object.")] String SchemaName;
    [Key, Description("Specifies the name of the database object to set permission for. Can be an empty value when setting permission for a schema.")] String ObjectName;
    [Key, Description("Specifies the type of the database object specified in parameter **ObjectName**."), ValueMap{"Schema", "Table","View","StoredProcedure"}, Values{"Schema", "Table","View","StoredProcedure"}] String ObjectType;
    [Key, Description("Specifies the name of the database user, user-defined database role, or database application role that will have the permission.")] String Name;
    [Required, EmbeddedInstance("DSC_DatabaseObjectPermission"), Description("Specifies the permissions for the database object and the principal. The permissions is an array of embedded instances of the `DSC_DatabaseObjectPermission` CIM class.")] String Permission[];
    [Write, Description("Specifies the host name of the _SQL Server_ to be configured. Default value is `$env:COMPUTERNAME`.")] String ServerName;
    [Write, Description("Specifies that permissions that has parameter **Ensure** set to `'Present'` (the default value for permissions) should always be enforced even if that encompasses cascading revocations. An example if the desired state is `'Grant'` but the current state is `'GrantWithGrant'`. If parameter **Force** is set to `$true` the _With Grant_ permission is revoked, if set to `$false` an exception is thrown since the desired state could not be set. Default is to throw an exception.")] Boolean Force;
};
 
[ClassVersion("1.0.0")]
class DSC_DatabaseObjectPermission
{
    [Key, Description("Specifies the state of the permission."), ValueMap{"Grant","Deny","GrantWithGrant"}, Values{"Grant","Deny","GrantWithGrant"}] String State;
    [Required, Description("Specifies a set of permissions. Valid permission names can be found in the article [ObjectPermissionSet Class properties](https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.management.smo.objectpermissionset#properties).")] String Permission[];
    [Write, Description("Specifies the desired state of the permission. When set to `'Present'` the permissions will be added. When set to `'Absent'` the permissions will be removed. Default value is `'Present'`."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};