$67 GRAYBYTE WORDPRESS FILE MANAGER $11

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/node_modules/npm/lib/install/

HOME
Current File : /usr/lib/node_modules/npm/lib/install//check-permissions.js
'use strict'
var path = require('path')
var log = require('npmlog')
var validate = require('aproba')
var uniq = require('lodash.uniq')
var asyncMap = require('slide').asyncMap
var npm = require('../npm.js')
var exists = require('./exists.js')
var writable = require('./writable.js')

module.exports = function (actions, next) {
  validate('AF', arguments)
  var errors = []
  asyncMap(actions, function (action, done) {
    var cmd = action[0]
    var pkg = action[1]
    switch (cmd) {
      case 'add':
        hasAnyWriteAccess(path.resolve(pkg.path, '..'), errors, done)
        break
      case 'update':
      case 'remove':
        hasWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.path, '..'), errors, done))
        break
      case 'move':
        hasAnyWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.fromPath, '..'), errors, done))
        break
      default:
        done()
    }
  }, function () {
    if (!errors.length) return next()
    uniq(errors.map(function (er) { return 'Missing write access to ' + er.path })).forEach(function (er) {
      log.warn('checkPermissions', er)
    })
    npm.config.get('force') ? next() : next(errors[0])
  })
}

function andHasWriteAccess (dir, errors, done) {
  validate('SAF', arguments)
  return function () {
    hasWriteAccess(dir, errors, done)
  }
}

function hasAnyWriteAccess (dir, errors, done) {
  validate('SAF', arguments)
  findNearestDir()
  function findNearestDir () {
    var nextDir = path.resolve(dir, '..')
    exists(dir, function (dirDoesntExist) {
      if (!dirDoesntExist || nextDir === dir) {
        return hasWriteAccess(dir, errors, done)
      } else {
        dir = nextDir
        findNearestDir()
      }
    })
  }
}

function hasWriteAccess (dir, errors, done) {
  validate('SAF', arguments)
  writable(dir, function (er) {
    if (er) errors.push(er)
    done()
  })
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
action
--
31 Aug 2024 8.02 AM
root / root
0755
access-error.js
0.197 KB
10 Mar 2021 9.36 PM
root / root
0644
actions.js
5.516 KB
10 Mar 2021 9.36 PM
root / root
0644
and-add-parent-to-errors.js
0.366 KB
10 Mar 2021 9.36 PM
root / root
0644
and-finish-tracker.js
0.352 KB
10 Mar 2021 9.36 PM
root / root
0644
and-ignore-errors.js
0.199 KB
10 Mar 2021 9.36 PM
root / root
0644
audit.js
8.243 KB
10 Mar 2021 9.36 PM
root / root
0644
check-permissions.js
1.853 KB
10 Mar 2021 9.36 PM
root / root
0644
copy-tree.js
0.752 KB
10 Mar 2021 9.36 PM
root / root
0644
decompose-actions.js
2.18 KB
10 Mar 2021 9.36 PM
root / root
0644
deps.js
30.32 KB
10 Mar 2021 9.36 PM
root / root
0644
diff-trees.js
9.119 KB
10 Mar 2021 9.36 PM
root / root
0644
exists.js
0.757 KB
10 Mar 2021 9.36 PM
root / root
0644
flatten-tree.js
0.997 KB
10 Mar 2021 9.36 PM
root / root
0644
fund.js
1.282 KB
10 Mar 2021 9.36 PM
root / root
0644
get-requested.js
0.62 KB
10 Mar 2021 9.36 PM
root / root
0644
has-modern-meta.js
0.686 KB
10 Mar 2021 9.36 PM
root / root
0644
inflate-bundled.js
0.613 KB
10 Mar 2021 9.36 PM
root / root
0644
inflate-shrinkwrap.js
8.873 KB
10 Mar 2021 9.36 PM
root / root
0644
is-dev-dep.js
0.171 KB
10 Mar 2021 9.36 PM
root / root
0644
is-extraneous.js
0.604 KB
10 Mar 2021 9.36 PM
root / root
0644
is-fs-access-available.js
0.745 KB
10 Mar 2021 9.36 PM
root / root
0644
is-only-dev.js
1.238 KB
10 Mar 2021 9.36 PM
root / root
0644
is-only-optional.js
0.658 KB
10 Mar 2021 9.36 PM
root / root
0644
is-opt-dep.js
0.181 KB
10 Mar 2021 9.36 PM
root / root
0644
is-prod-dep.js
0.168 KB
10 Mar 2021 9.36 PM
root / root
0644
module-staging-path.js
0.253 KB
10 Mar 2021 9.36 PM
root / root
0644
mutate-into-logical-tree.js
4.516 KB
10 Mar 2021 9.36 PM
root / root
0644
node.js
1.851 KB
10 Mar 2021 9.36 PM
root / root
0644
read-shrinkwrap.js
3.672 KB
10 Mar 2021 9.36 PM
root / root
0644
realize-shrinkwrap-specifier.js
0.606 KB
10 Mar 2021 9.36 PM
root / root
0644
report-optional-failure.js
1.017 KB
10 Mar 2021 9.36 PM
root / root
0644
save.js
5.908 KB
10 Mar 2021 9.36 PM
root / root
0644
update-package-json.js
1.87 KB
10 Mar 2021 9.36 PM
root / root
0644
validate-args.js
2.731 KB
10 Mar 2021 9.36 PM
root / root
0644
validate-tree.js
3.104 KB
10 Mar 2021 9.36 PM
root / root
0644
writable.js
1.003 KB
10 Mar 2021 9.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF