Jump to content

Recommended Posts

Posted

I'm not a scripter and have done very little other than import recipes that are all ready in the system but now I want something complex (well it is to me).

 

inputs.job.clientIP

inputs.user.isInGroup(groupName)

actions.job.chargeToPersonalAccount()

 

Using the above I want to specify an IP range and a group for it to charge a personal balance, how do I use these actions?

Posted

Hi Matt,

 

I would try something like this

 

function printJobHook(inputs, actions) {

 if (!inputs.job.isAnalysisComplete) { return; }

 var ALLOWED_SUBNET = '10.150.150.';

 var allowed = inputs.job.clientIP.search(ALLOWED_SUBNET);
 if (allowed == 0) {
   if (inputs.user.isInGroup(Students)) {
     actions.job.chargeToPersonalAccount();
   }
 }
}

 

look at changing the subnet and group and it should do what you need.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...