Arcana Development logo
Site Search:
  • Home
  • Products
    • Products Overview
    • adTempus
    • Report Commander
    • Arcana Scheduler
  • Support
    • Support Home
    • Knowledge Base
    • License Management
    • Contact Support
  • Community
  • Purchase
    • Pricing and Ordering
    • Additional Purchasing Information
  • Contact
  • About Us
  • Forum HelpHelp
  • Log In
  • Register

Community

Arcana Development Forums > adTempus > API > Set job security
{1}
##LOC[OK]##
{1}
##LOC[OK]## ##LOC[Cancel]##
{1}
##LOC[OK]## ##LOC[Cancel]##

Answered Question Set job security RSS Feed Icon

You must be logged in to reply to this topic.

1
(Showing 1 to 3 of 3)
Avatar
yr2yr
Joined: February 9, 2009
Posts: 5
Posted April 22, 2009 12:11:17 AM
 

I am writing ADTempus 3.0 Client application and need the vb code to add security to a job.  I want to give an AD group modify rights to the job.  Can you give me a sample?  Thanks.

 

 

 
Avatar
Bill
Arcana Development Staff
Joined: September 21, 2007
Posts: 79
Posted April 22, 2009 9:10:25 AM
 
Here is the code to add "Modify" rights for a user or group. For userName specify the group name, such as "domain\adTempus Operators".

    'This method will grant "Modify" permission on a job to a specified user. 
    Public Sub AddModifyPermission(ByVal job As ijob, ByVal userName As String) 
        Dim securityDescriptor As ISecurityDescriptor 
        Dim ace As IADTAce 
 
        'Get the SecurityDescriptor for the job 
        securityDescriptor = CType(job, IADTSecuredObject).SecurityDescriptor 
 
        'Get the Access Control Entry (ACE) for the specified user. 
        'The userName must be a valid Windows login ID, including the domain if appropriate, 
        'e.g., "domain\username". 
        'GetAceForName will thrown an exception if the user cannot be found. 
        'The flags argument specifies the inheritance for the ACE. In this case it's 
        'irrelevant because nothing inherits security from a job. If we were modifying a 
        'group or other container, we could use different AceFlagsEnum values to set  
        'permissions that are inherited by objects in the container. 
        ace = securityDescriptor.GetAceForName(userName, AceFlagsEnum.aceInheritNone) 
 
        'Add Modify permission to the user's permissions. 
        ace.GrantMask = ace.GrantMask Or SecurityActionsEnum.saModify 
 
        'Must save the changes to the SecurityDescriptor 
        securityDescriptor.Save() 
 
        'And then save the job 
        job.Save() 
    End Sub 
 

It assumes you have already created a session and retrieved the job.

 
Avatar
yr2yr
Joined: February 9, 2009
Posts: 5
Posted April 22, 2009 11:05:18 AM
 
Thanks Bill
 
  Copyright 2012 Arcana Development, LLC. Use of this site signifies your agreement to the terms of use and privacy policy.