{"id":18348708,"url":"https://github.com/paraboly/permissionservice","last_synced_at":"2025-04-06T09:31:45.977Z","repository":{"id":35190263,"uuid":"216763747","full_name":"Paraboly/PermissionService","owner":"Paraboly","description":"Generic Permission Service with Jest Test via Paraboly","archived":false,"fork":false,"pushed_at":"2023-03-03T08:22:02.000Z","size":254,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T09:13:33.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://paraboly.com","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/Paraboly.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":"2019-10-22T08:35:54.000Z","updated_at":"2021-09-21T15:00:19.000Z","dependencies_parsed_at":"2023-01-15T15:49:44.864Z","dependency_job_id":null,"html_url":"https://github.com/Paraboly/PermissionService","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paraboly%2FPermissionService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paraboly%2FPermissionService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paraboly%2FPermissionService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paraboly%2FPermissionService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paraboly","download_url":"https://codeload.github.com/Paraboly/PermissionService/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463744,"owners_count":20942935,"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":[],"created_at":"2024-11-05T21:18:54.205Z","updated_at":"2025-04-06T09:31:45.661Z","avatar_url":"https://github.com/Paraboly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cimg alt=\"Generic Permission Service\" src=\"assets/logo.png\" width=\"1050\"/\u003e\n\n\n[![Generic Permission Service with Jest Test via Paraboly](https://img.shields.io/badge/-Generic%20Permission%20Service%20with%20Jest%20Test%20via%20Paraboly-lightgrey?style=for-the-badge)](https://github.com/Paraboly/pwc-permission-service)\n\n\n[![npm version](https://img.shields.io/npm/v/@paraboly/pwc-permission-service.svg?style=for-the-badge)](https://www.npmjs.com/package/@paraboly/pwc-permission-service)\n[![npm](https://img.shields.io/npm/dt/@paraboly/pwc-permission-service.svg?style=for-the-badge)](https://www.npmjs.com/package/@paraboly/pwc-permission-service)\n![Platform - Platform Free Web](https://img.shields.io/badge/-Web%20%7C%20Platform%20Free-blue?style=for-the-badge)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n\n# Architecture of Using Permission Service\n\n| Types            | Values | Example    | Example2      |\n| ---------------- | ------ | ---------- | ------------- |\n| NAMESPACE        | 0      | permission | permission    |\n| MODULE           | 1      | system     | system        |\n| PAGE             | 2      | globalMap  | globalMap     |\n| COMPONENT        | 3      | *          | button        |\n| COMPONENT ID     | 4      | *          | delete_button |\n| PERMISSION VALUE | 5      | 7          | 0             |\n\n## Installation\n\n```js\nnpm i @paraboly/pwc-permission-service\n```\n\n# Usage\n\n## Import\n\n```js\nimport PermissionService from \"@paraboly/pwc-permission-service\";\n```\n\n## Basic Usage\n\n### Generate Permission Object from Encoded Permission String\n\nGenerate (Decode) the given encoded permission string to usable object\n\n```js\nconst {\n  generatePermissionObj,\n} = PermissionService;\n\nconst permissionObj = generatePermissionObj(permission);\nconsole.log(\"Permission Object: \", permissionObj);\n```\n\n### Decode Selected Permission\n\nPlease check the permission architecture about the permission of the each type.\n\n```js\nconst {\n  decodeSelectedPermission\n} = PermissionService;\n\nconst module = decodeSelectedPermission(1, permission);\nconst page = decodeSelectedPermission(2, permission);\nconst permissionValue = decodeSelectedPermission(\n  5,\n  permission\n);\n```\n\n### Generate Permission Encode\n\nGenerate the fundamental encoded permission string with given parameters\n\n```js\nPermissionService.generatePermissionEncode(\n  \"permission\",\n  \"system\",\n  \"globalMap\",\n  \"*\",\n  \"delete_button\",\n  7\n)\n```\n\n## Authors\n\nFreakyCoder, kuray.ogun@paraboly.com | kurayogun@gmail.com\n\n## License\n\nPermission Service is available under the Apache License 2.0 license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaboly%2Fpermissionservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparaboly%2Fpermissionservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaboly%2Fpermissionservice/lists"}