
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@zohodesk/permissions
Advanced tools
permissions licenses and plans, user validations handling for whole app
import { READ_ONLY, SHOW, HIDE } from '@zohodesk/permissions'
const restrictionRules = {
<group-name>: {
<features>: {
<feature-action-1>: [SHOW, READ_ONLY], //In array 1th position meant can we show ?, 2st position meant to can we readOnly ?
<feature-action-2>: [SHOW, READ_ONLY],
<feature-action-3>: [HIDE]
}
}
}
};
const readyOnlyMessages = {
<group-name>: {
<features>: {
<feature-action-1>: message ,
<feature-action-2>: message ,
<feature-action-3>: message
}
}
};
const restrictionRules = {
tickets: {
isSpam: {
secondaryContact: [SHOW, READ_ONLY],
timeline: [HIDE],
mergeTicket: [SHOW, READ_ONLY],
edit : [SHOW]
}
},
bluePrintApplied: {
status: [SHOW, READ_ONLY],
move: [HIDE],
edit : [HIDE]
}
},
contacts: {
anonymous_users : {
edit: [HIDE],
follow: [HIDE],
add_tickets: [SHOW, READ_ONLY],
add_products: [SHOW]
}
}
}
};
const readOnlyMessages = {
contacts: {
anonymous_users: {
edit: 'support.contacts.edit.field.locked',
add_tickets: 'support.add_tickets.field.locked',
add_products: 'support.add_products.field.locked'
}
};
const permission = {
"tickets" : {
create: true,
delete: true,
edit: true,
export: true,
import: true,
view: true
}
}
const license = {
agentAllowed: true,
agentMaxCount: "100",
manualTimeTrackingAllowed: true,
ticketTemplateAllowed: true,
timeTrackingAllowed: true,
twilioAllowed: true,
webFormsAllowed: true
}
import { PermissionProvider } from '@zohodesk/permissions'
<PermissionProvider
{permission}
{license}
{restrictionRules}
{lockMessages}
>
{component}
</PermissionProvider>
import { restrictionProviderUtils } from '@zohodesk/permissions';
restrictionProviderUtils.getRestriction(features=[...], group-name , feature-action-1);
restrictionProviderUtils.getRestriction(['isSpam','bluePrintApplied'],'tickets','edit')
restrictionProviderUtils.getRestriction('isSpam','tickets','edit')
import { RestrictionValidator } from '@zohodesk/permissions';
<RestrictionValidator module={group-name}
features={features [] or feature string}
action={feature or action}>
{({isReadOnly,readOnlyMessage})=>{
return (<span>
<Icon name='ZD-addNew' iconClass={iconClass} /> Add product
</span>)
}}
</RestrictionValidator>
YourComponent - we will add few props based on the restriction values - ReadOnly, readOnlyMessage
isShow : false - By default, we will return null. In this case children won't be rendered.
<RestrictionValidator module={group-name}
features={features [] or feature string}
action={feature or action}>
<YourComponent />
</RestrictionValidator>
handleShowHide - you can handle the show/hide 'isShow' into you component, simply passing props
handleShowHide={false}
<RestrictionValidator module={group-name} handleShowHide={false}
features={features [] or feature string}
action={feature or action}>
{({isShow,isReadOnly,readOnlyMessage})=>{
if(!isShow){
return (<span>Add Contact</span>)
}
return (<span>
<Icon name='ZD-addNew' iconClass={iconClass} /> Add product
</span>)
}}
</RestrictionValidator>
import { licensePermissionCheckHOC } from '@zohodesk/permissions';
licensePermissionCheckHOC({
validation : {
license : ... ,
permission : ...
},
customValdation : {...},
Fallback : func..
})(YourComponent);
license - used to verify with user license. * , Any other
permission - used to verify with user permissions. * , Any other
* - Means all.
import { connect } from 'react-redux';
import { compose } from 'redux';
import { getPermission } from 'provider';
import { ALL , licensePermissionCheckHOC } from '@zohodesk/permissions';
export defult compose(connect(...),
licensePermissionCheckHOC({
validation : {
license : ALL,
permission : getPermission("tickets", "create")
},
customValdation : {...},
Fallback : func..
})
)(YourComponent);
import { connect } from 'react-redux';
import { compose } from 'redux';
import { getPermission } from 'provider';
import { ALL , licensePermissionCheckHOC } from '@zohodesk/permissions';
export defult compose(connect(...),
licensePermissionCheckHOC({
validation : {
license : ALL,
permission : getPermission("tickets", "create") + "&&"+ getPermission("tickets", "edit")
},
customValdation : {...},
Fallback : func..
})
)(YourComponent);
let YourComponentNew = licensePermissionCheckHOC({
validation : {
license : ALL,
permission : ALL
},
customValdation : {
canMove :(props)=>{
let { module , checkMoveOption } = props;
let permission = `${module}_view`;
if(crossDepartmentsMove){
permission += `&&${module}_crossDepartmentMove`
}
return {
permission ,
obj : true,
falseObj : false
}
}
},
Fallback : func..
})(YourComponent);
<YourComponentNew module="tickets" checkMoveOption={true} />
<YourComponentNew module="tasks" checkMoveOption={true} />
import { licensePermissionProviderUtils } from '@zohodesk/permissions';
let {licenseSuccess, permissionSuccess, permissionProps, failedCases} = licensePermissionProviderUtils.getLicensePermissionCheck({
license : ALL,
permission : ALL
});
if(licenseSuccess && permissionSuccess){
return <Component />
}
import { LicensePermissionHandler } from '@zohodesk/permissions';
<LicensePermissionHandler
SuccessComponent={YourComponent}
FallbackComponent={null}
validationProps={{
license : ALL,
permission : ALL
}}
/>
FAQs
permissions licenses and plans, user validations handling for whole app
The npm package @zohodesk/permissions receives a total of 181 weekly downloads. As such, @zohodesk/permissions popularity was classified as not popular.
We found that @zohodesk/permissions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.