{"id":31196268,"url":"https://github.com/confuser/node-fellowship","last_synced_at":"2025-09-20T04:49:37.579Z","repository":{"id":29020635,"uuid":"32547871","full_name":"confuser/node-fellowship","owner":"confuser","description":"An unopinionated bitwise memory based ACL","archived":false,"fork":false,"pushed_at":"2017-01-19T10:18:08.000Z","size":28,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-05T08:16:17.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/confuser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-19T21:45:43.000Z","updated_at":"2017-10-28T23:50:15.000Z","dependencies_parsed_at":"2022-09-05T21:11:02.585Z","dependency_job_id":null,"html_url":"https://github.com/confuser/node-fellowship","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/confuser/node-fellowship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confuser%2Fnode-fellowship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confuser%2Fnode-fellowship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confuser%2Fnode-fellowship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confuser%2Fnode-fellowship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/confuser","download_url":"https://codeload.github.com/confuser/node-fellowship/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confuser%2Fnode-fellowship/sbom","scorecard":{"id":302407,"data":{"date":"2025-08-11","repo":{"name":"github.com/confuser/node-fellowship","commit":"dd236797bc5d094c6ea48dfa36ab9e1ba61787d1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-17T21:02:17.741Z","repository_id":29020635,"created_at":"2025-08-17T21:02:17.741Z","updated_at":"2025-08-17T21:02:17.741Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276047233,"owners_count":25575881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-20T04:49:35.073Z","updated_at":"2025-09-20T04:49:37.569Z","avatar_url":"https://github.com/confuser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fellowship\n\n[![build status](https://secure.travis-ci.org/confuser/node-fellowship.png)](http://travis-ci.org/confuser/node-fellowship)\n[![Coverage Status](https://coveralls.io/repos/confuser/node-fellowship/badge.png?branch=master)](https://coveralls.io/r/confuser/node-fellowship?branch=master)\n\n\nAn unopinionated bitwise memory based ACL. To be used as a low level base for implementing a persistant module.\n\n## Installation\n\n```\nnpm install fellowship --save\n```\n\n## Usage\n```js\nvar Fellowship = require('fellowship')\n  , resources = { resourceOne: { permission1: 1, permission2: 2, permission3: 4 }  }\n  , groups = { Admin: { resourceOne: 6 }}\n  , acl = new Fellowship(resources, groups)\n\nacl.hasPermission('Admin', 'resourceOne', 'permission1') // false\nacl.hasPermission('Admin', 'resourceOne', 'permission2') // true\nacl.hasPermission('Admin', 'resourceOne', 'permission3') // true\n\n// Moderator\nacl.addResource('Blog', [ 'create,', 'read', 'update', 'delete' ])\nacl.addGroup('Moderator')\nacl.addPermission('Moderator', 'Blog', 'create')\nacl.hasPermission('Moderator', 'Blog', 'create') // true\n\n// Root\nacl.addGroup('Root')\nacl.addPermission('Root', 'Blog', '*')\nacl.hasPermission('Root', 'Blog', 'read') // true\n```\n\n## Methods\n### addGroup (name, [resourcePermissions])\n* name - The identifier to the group, either a name or a data based id\n* resourcePermissions - An optional object of permissions, e.g. `{ permission1: 1, permission2: 2, permission3: 4 }`\n\n### addResource (name, permissions)\n* name - The identifier to the resource, either a name or a data based id\n* permissions - An array of permissions, e.g. `[ 'create,', 'read', 'update', 'delete' ]`\n\n### addPermission (groupName, resourceName, permissionName)\n* groupName - The identifier to the group, either a name or a data based id\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionName - Self explanatory, will throw an error if resource does not have such a permission\n\n### addPermission (groupName, resourceName, permissionNames)\n* groupName - The identifier to the group, either a name or a data based id\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionNames - Self explanatory, array of permission names, will throw an error if resource does not have such a permission\n\nInternally uses addPermission\n\n### deleteGroup (groupName)\n* groupName - The identifier to the group, either a name or a data based id\n\n### deletePermission (resourceName, permissionName)\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionName - Self explanatory, will throw an error if resource does not have such a permission\n\nRecalculates permission values and group resource values\n\n### deleteResource (resourceName)\n* resourceName - The identifier to the resource, either a name or a data based id\n\nAlso removes the resource from all groups, use removeResource to only remove it from a particular group\n\n### getGroup (name)\n* groupName - The identifier to the group, either a name or a data based id\n\nReturns the groups resource permissions\n\n### getResource (name)\n* name - The identifier to the resource, either a name or a data based id\n\nReturns the resources permissions and their associated 'bit' value\n\n### hasPermission (groupName, resourceName, permissionName)\n* groupName - The identifier to the group, either a name or a data based id\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionName - Self explanatory, will throw an error if resource does not have such a permission\n\nReturns true if group has permission, false if not\n\n### newPermission (resourceName, permissionName)\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionName - Self explanatory, will throw an error if resource does not have such a permission\n\nAdds a new permission to the resource, maximum of 31 permissions per resource\n\n### removePermission (groupName, resourceName, permissionName)\n* groupName - The identifier to the group, either a name or a data based id\n* resourceName - The identifier to the resource, either a name or a data based id\n* permissionName - Self explanatory, will throw an error if resource does not have such a permission\n\nRemoves the permission from the group, and recalculates resource value for group\n\n### removeResource (groupName, resourceName)\n* groupName - The identifier to the group, either a name or a data based id\n* resourceName - The identifier to the resource, either a name or a data based id\n\nRemoves the resource from the group\n\n## Events\nEvery method apart from getters emit an event\n\n```js\nfellowship.on('permission.removed', function (groupName, resourceName, permissionName) {\n  console.log(groupName, resourceName, permissionName)\n})\n```\n\n* group.added (name, resourcePermissions)\n\n* permission.added (groupName, resourceName, permissionName)\n\n* permissions.added (groupName, resourceName, permissions)\n\n* resource.added (name, permissions)\n\n* group.deleted (name)\n\n* permission.deleted (resourceName, permissionName)\n\n* resource.deleted (resourceName)\n\n* permission.new (resourceName, permissionName)\n\n* permission.removed (groupName, resourceName, permission)\n\n* resource.removed (groupName, resourceName)\n\n## FAQ\n### Why is there a limit on the amount of permissions per resource?\nThis is due to 32bit operations within JavaScript. If you find yourself needing a resource with more than 31 permissions, you should look into refactoring.\n\n#### Bad\n```js\nfellowship.addResource('Forum', [ 'createtopic', 'createpost', 'locktopic' ])\n```\n\n#### Good\n```js\nfellowship.addResource('Topic', [ 'create', 'lock' ])\nfellowship.addResource('Post', [ 'create', 'edit', 'delete' ])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfuser%2Fnode-fellowship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfuser%2Fnode-fellowship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfuser%2Fnode-fellowship/lists"}