packages/udaru-core/lib/ops/organizationOps.js
function deleteOrganizationAttachedPolicy (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, policyId, instance } = params
      const tasks = [
        (job, next) => {
          Joi.validate({ id, policyId, instance }, validationRules.deleteOrganizationPolicy, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.id = id
          job.policyId = policyId
          job.instance = instance

          next()
        },
        checkOrg,
        clearOrganizationAttachedPolicy
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)

        organizationOps.readById(id, cb)
      })

      return promise
    }
function deleteOrganizationAttachedPolicy (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, policyId, instance } = params
      const tasks = [
        (job, next) => {
          Joi.validate({ id, policyId, instance }, validationRules.deleteOrganizationPolicy, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.id = id
          job.policyId = policyId
          job.instance = instance

          next()
        },
        checkOrg,
        clearOrganizationAttachedPolicy
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)

        organizationOps.readById(id, cb)
      })

      return promise
    }
function deleteOrganizationAttachedPolicy ( params , cb ) { let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( ) const { id , policyId , instance } = params const tasks = [ ( job , next ) => { Joi . validate ( { id , policyId , instance } , validationRules . deleteOrganizationPolicy , ( err ) => { if ( err ) return next ( Boom . badRequest ( err ) ) next ( ) } ) } , ( job , next ) => { job . id = id job . policyId = policyId job . instance = instance next ( ) } , checkOrg , clearOrganizationAttachedPolicy ] db . withTransaction ( tasks , ( err , res ) => { if ( err ) return cb ( err ) organizationOps . readById ( id , cb ) } ) return promise }
Remove one organization policy

@param  {Object}   params { id, policyId, instance } "instance" optional
@param  {Function} cb
Remove one organization policy