MCPcopy
hub / github.com/scality/cloudserver / _handleAuthResults

Function _handleAuthResults

lib/api/bucketPut.js:138–157  ·  view source on GitHub ↗
(locationConstraint, log, cb)

Source from the content-addressed store, hash-verified

136}
137
138function _handleAuthResults(locationConstraint, log, cb) {
139 return (err, authorizationResults) => {
140 if (err) {
141 return cb(err);
142 }
143 if (!authorizationResults.every(res => {
144 if (Array.isArray(res)) {
145 return res.every(subRes => subRes.isAllowed);
146 }
147 return res.isAllowed;
148 })) {
149 log.trace(
150 'authorization check failed for user',
151 { locationConstraint },
152 );
153 return cb(errors.AccessDenied);
154 }
155 return cb(null, locationConstraint);
156 };
157}
158
159function _isObjectLockEnabled(headers) {
160 const header = headers['x-amz-bucket-object-lock-enabled'];

Callers 2

bucketPutFunction · 0.85
bucketPut.jsFile · 0.85

Calls 1

traceMethod · 0.80

Tested by

no test coverage detected