Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rhases-nodejs-commons

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rhases-nodejs-commons - npm Package Compare versions

Comparing version 0.2.19 to 0.2.20

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="0.2.20"></a>
## [0.2.20](https://github.com/rhases/rhases-nodejs-commons/compare/v0.2.19...v0.2.20) (2017-10-04)
<a name="0.2.19"></a>

@@ -7,0 +12,0 @@ ## [0.2.19](https://github.com/rhases/rhases-nodejs-commons/compare/v0.2.18...v0.2.19) (2017-10-03)

2

dist/crud/access-control-base.controller.d.ts

@@ -12,3 +12,3 @@ import { Promise } from 'q';

findById(req: any, res: Response, exQueryBuilder?: (DocumentQuery) => DocumentQuery<any, any>): void;
restrictedQueryBuilderFactory(grant: any, user: any, exQueryBuilder: any): () => (query: any) => any;
restrictedQueryBuilderFactory(grant: any, user: any, exQueryBuilder?: any): () => (query: any) => any;
update(req: any, res: Response): void;

@@ -15,0 +15,0 @@ patch(req: any, res: Response): void;

@@ -51,4 +51,5 @@ "use strict";

var restrictedQueryBuilder = function (query) {
var organizationCode = user.organization && user.organization.ref ? user.organization.ref.code : undefined;
return functions_utils_1.now(query)
.then(promise_grants_utils_1.ifGrantedForOwn(grant, base_query_builder_1.restrictByOwner(grant.ownerTypes, user._id, user.organization && user.organization.ref.code)))
.then(promise_grants_utils_1.ifGrantedForOwn(grant, base_query_builder_1.restrictByOwner(grant.ownerTypes, user._id, organizationCode)))
.then(promise_grants_utils_1.ifDefined(exQueryBuilder))

@@ -64,3 +65,4 @@ .value();

return Q.when()
.then(self.findBydId(req.params.id, req.user, grant))
.then(self.restrictedQueryBuilderFactory(grant, user))
.then(base_query_builder_1.execFindByIdWithQueryBuilder(self.model, req.params.id))
.then(controller_utils_1.handleEntityNotFound(res))

@@ -74,3 +76,4 @@ .then(entity_utils_1.applyUpdate(req.body));

return Q.when()
.then(self.findBydId(req.params.id, req.user, grant))
.then(self.restrictedQueryBuilderFactory(grant, user))
.then(base_query_builder_1.execFindByIdWithQueryBuilder(self.model, req.params.id))
.then(controller_utils_1.handleEntityNotFound(res))

@@ -84,3 +87,4 @@ .then(entity_utils_1.applyPatch(req.body));

return Q.when()
.then(self.findBydId(req.params.id, user, grant))
.then(self.restrictedQueryBuilderFactory(grant, user))
.then(base_query_builder_1.execFindByIdWithQueryBuilder(self.model, req.params.id))
.then(controller_utils_1.handleEntityNotFound(res))

@@ -87,0 +91,0 @@ .then(entity_utils_1.removeEntity())

import { CrudAccessControl } from './access-control.authorization';
import { Promise } from 'q';
export declare function crudAccessControlWithOrgRolesFactory(resource: any, grants: any): Promise<CrudAccessControl>;

@@ -0,0 +0,0 @@ import { AccessControl, Permission } from 'accesscontrol';

@@ -0,0 +0,0 @@ 'use strict';

export declare function checkAuthorization(op: any, req: any): (entity: any) => any;
export declare function restrictByUser(req: any): (query: any) => any;

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ import { Request, Response } from 'express';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export * from './logger';

@@ -0,0 +0,0 @@ "use strict";

declare const l: any;
export default l;

@@ -0,0 +0,0 @@ "use strict";

export declare function OwnerSchemaFactory(): any;

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

declare var assert: any;

@@ -0,0 +0,0 @@ var assert = require('assert');

@@ -0,0 +0,0 @@ import { Model, Document, DocumentQuery } from 'mongoose';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ import { Response } from 'express';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model, Document } from 'mongoose';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare function concatFunctions(firstFnc: any, secondFnc: any): any;

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ import { Grant } from '../crud/access-control.authorization';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ "use strict";

{
"name": "rhases-nodejs-commons",
"version": "0.2.19",
"version": "0.2.20",
"description": "Node.js utilities",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc