New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@studyportals/client-internal-platform-authorization

Package Overview
Dependencies
Maintainers
19
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@studyportals/client-internal-platform-authorization - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

package.json
{
"name": "@studyportals/client-internal-platform-authorization",
"version": "1.0.0",
"version": "1.1.0",
"description": "Typescript library containing resources that facilitate performing user privileges checks for operations exposed in client and internal facing products.",

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

@@ -25,2 +25,9 @@ /**

/**
* Checks whether the specified user can access the given study.
*
* @param username The username of the user whose privileges are to be checked.
* @param studyId The ID of the targeted study.
*/
canAccessStudy(username: string, studyId: string): Promise<boolean>;
/**
* Filters an array of organisation IDs, considering whether the given user has access to their data.

@@ -27,0 +34,0 @@ *

@@ -12,2 +12,3 @@ import { ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";

canAccessOrganisation(username: string, organisationId: string): Promise<boolean>;
canAccessStudy(username: string, studyId: string): Promise<boolean>;
filterOrganisationsByUserAccess(username: string, organisationIds: string[]): Promise<string[]>;

@@ -14,0 +15,0 @@ filterCampaignsByUserAccess(username: string, campaignIds: string[]): Promise<string[]>;

@@ -43,2 +43,9 @@ "use strict";

}
canAccessStudy(username, studyId) {
const request = this.requestsFactory.post(`${this.baseUrl}studies`);
return new Promise((resolve) => {
request.send({ username: username, studyId: studyId });
request.end((err, res) => this.handleAuthorizationRequest(err, res, resolve));
});
}
filterOrganisationsByUserAccess(username, organisationIds) {

@@ -45,0 +52,0 @@ const request = this.requestsFactory.post(`${this.baseUrl}organisations/multiple`);

Sorry, the diff of this file is not supported yet

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