{"id":21992580,"url":"https://github.com/tecc/permittere","last_synced_at":"2025-10-18T03:55:26.330Z","repository":{"id":39901314,"uuid":"492776721","full_name":"tecc/permittere","owner":"tecc","description":"A simple permissions library","archived":false,"fork":false,"pushed_at":"2022-08-05T16:45:54.000Z","size":144,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-28T22:16:28.556Z","etag":null,"topics":["access-control","javascript","library","nodejs","permissions","security","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tecc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-16T09:56:27.000Z","updated_at":"2023-04-12T18:35:09.000Z","dependencies_parsed_at":"2022-08-09T15:36:11.415Z","dependency_job_id":null,"html_url":"https://github.com/tecc/permittere","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecc%2Fpermittere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecc%2Fpermittere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecc%2Fpermittere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecc%2Fpermittere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tecc","download_url":"https://codeload.github.com/tecc/permittere/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052619,"owners_count":20553161,"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","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":["access-control","javascript","library","nodejs","permissions","security","typescript"],"created_at":"2024-11-29T20:14:11.632Z","updated_at":"2025-10-18T03:55:21.282Z","avatar_url":"https://github.com/tecc.png","language":"TypeScript","readme":"# permittere \n[![npm](https://img.shields.io/npm/v/permittere?label=latest\u0026style=flat-square)](https://npmjs.com/package/permittere)\n[![development branch](https://img.shields.io/github/package-json/v/tecc/permittere?label=development%20branch\u0026style=flat-square)](https://github.com/tecc/permittere)\n[![code coverage](https://img.shields.io/codecov/c/gh/tecc/permittere?style=flat-square)](https://github.com/tecc/permittere)\n[![tests](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftecc%2Fpermittere%2Fbadge%3Fref%3Ddev\u0026style=flat-square)](https://github.com/tecc/permittere/commits/dev)\n\npermittere is a simple permissions library. Note that this library is new and could use feature ideas.\n\nThe word `permittere` comes from Latin, meaning roughly \"allow\", \"grant\", or \"permit\" ([see here](https://en.wiktionary.org/wiki/permitto#Latin)).\n\n## Usage\n\nThere's not much documentation on how to use it right now.\nThere's this example, but for the details you'll have to skim the code (there is documentation to help with it).\n\n```js\nconst { ManagedPermissionMap } = require(\"permittere\");\n\nconst map = new ManagedPermissionMap({\n  'myParentPermission': {\n    name: 'myParentPermission', // I know that that is slightly redundant but that's fine for now\n    default: true\n  },\n  'myChildPermission': {\n    name: 'myChildPermission',\n    default: false,\n    parents: [ 'myParentPermission' ] // Because this has a parent permission, the value of this permission will only matter if it was set directly (i.e. the entity explicitly has this permission)\n  }\n});\n\n/* Some examples with this map */\nmap.hasPermission('myParentPermission', {}) // (1) true; the entity has no explicit permissions so it uses the default\nmap.hasPermission('myParentPermission', { 'myParentPermission': false }) // (2) false; the entity explicitly does not have myParentPermission\nmap.hasPermission('myParentPermission', { 'myChildPermission': false }) // (3) true; children of a permission do not affect the parent\nmap.hasPermission('myChildPermission', {}) // (4) true; the parent permission is true which takes priority\nmap.hasPermission('myChildPermission', { 'myChildPermission': false }) // (5) false; myChildPermission is explicitly set to false, which takes priority\nmap.hasPermission('myChildPermission', { 'myParentPermission': false, 'myChildPermission': true }) // (6); as with case 5, an explicitly set permission takes priority\n```\n\n## Licence\n\n```\nCopyright 2022 tecc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecc%2Fpermittere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecc%2Fpermittere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecc%2Fpermittere/lists"}