# # Copyright (c) 2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverSecurityFileDirectory Task Module ## @author dl-nacl-dev@netapp.com,pkj@netapp.com ## @status shared ## @pod here =head1 NAME NACL::STask::VserverSecurityFileDirectory =head1 DESCRIPTION C provide methods to apply security settings of a policy. It is created on top of C component Since it is derived class of C, we can use all the methods of C from the object of this task. =cut package NACL::STask::VserverSecurityFileDirectory; use strict; use warnings; use NACL::CS::VserverSecurityFileDirectory; use base qw(NACL::C::VserverSecurityFileDirectory NACL::STask::STask); use Params::Validate qw(SCALAR); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head2 apply NACL::STask::VserverSecurityFileDirectory->apply( command_interface => $ci, 'vserver' => $vserver, nacltask_wait => 1, #default 1 ...); (Class method) This method is used to apply security settings of a policy. To preserve the security configuration of a file(or, folder) or set of files(or, folders) security policy has been defined. Policy is a container for tasks and a task associates a file/folder path name and the security descriptor that needs to be set on the file/folder. Every task in a policy is uniquely identified by the file/folder path. Policy can't have duplicate task entries and there is only one task per path. =over =item Options =over =item C<< command_interface => $command_interface >> (Required) See L =item C<< vserver => $vserver >> (Required) =item C<< 'policy-name' => $string >> (Required) =item C<< nacltask_wait=>0|1 >> (Optional) If 1 (the default), waits till ntfs acl is set to a file on a volume If 0, do not wait for ACL to be set on the file. =back =back =cut sub apply { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { nacltask_wait => { type => SCALAR, default => 1 }, }, allow_extra => 1, ignore_primary_keys => 1, ); my $wait = delete $opts{'nacltask_wait'}; my $job_component; $pkg->SUPER::apply(%opts, job_component => \$job_component); if ($job_component && $wait) { my %common_opts; $pkg->_copy_common_component_params( source => \%opts, target => \%common_opts ); $job_component->wait_on_job(%common_opts); } $Log->exit() if $may_exit; } 1;