{"id":24540011,"url":"https://github.com/spurtcms/team-roles","last_synced_at":"2025-03-16T04:43:06.553Z","repository":{"id":232388101,"uuid":"781822410","full_name":"spurtcms/team-roles","owner":"spurtcms","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-09T14:40:25.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-08-18T11:11:46.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spurtcms.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T05:26:47.000Z","updated_at":"2024-08-09T14:39:53.000Z","dependencies_parsed_at":"2024-08-27T15:06:42.265Z","dependency_job_id":null,"html_url":"https://github.com/spurtcms/team-roles","commit_stats":null,"previous_names":["spurtcms/team-roles"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fteam-roles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fteam-roles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fteam-roles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fteam-roles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spurtcms","download_url":"https://codeload.github.com/spurtcms/team-roles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826778,"owners_count":20354220,"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":"2025-01-22T17:17:53.311Z","updated_at":"2025-03-16T04:43:06.520Z","avatar_url":"https://github.com/spurtcms.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# team-roles Package\n\nThe 'team-roles' package empowers administrators to create specialized teams with diverse users and roles tailored for distinct domains. \n\n## Features\n\n- Creates access control settings for members, specifying the level of access they have to specific resources or functionalities within the system.\n- Updates the existing control settings with new configuration of permissions.\n\n\n# Installation\n\n``` bash\ngo get github.com/spurtcms/team-roles\n```\n# Usage Example\n\n\n```bash\nimport (\n\t\t\"github.com/spurtcms/auth\"\n\t\trole \"github.com/spurtcms/team-roles\"\n\t)\n\n\tfunc main(){\n\t\t\n\t\tNewAuth := auth.AuthSetup(newauth.Config{\n\t\t\tSecretKey: os.Getenv(\"JWT_SECRET\"),\n\t\t\tDB:        DB,\n\t\t})\n\t\t\n\t\ttoken, _ := Auth.CreateToken()\n\n\t\tAuth.VerifyToken(token, SecretKey)\n\n\t\tpermission, _ := Auth.IsGranted(\"Roles \u0026 Permission\", auth.CRUD)\n\t\t\n\t\tNewRoleWP := role.RoleSetup(role.Config{\n\t\t\tDB:               DB,\n\t\t\tAuthEnable:       true,\n\t\t\tPermissionEnable: false,\n\t\t\tAuthenticate:     NewAuth,\n\t\t})\n\t\t\n\t\tif permission{\n\t\t\n\t\t\t//list role\n\t\t\troles, rolecount, err := NewRole.RoleList(role.Rolelist{Limit: 10, Offset: 0})\n\t\t\tif err!=nil{\n\t\t\t\t//handle error\n\t\t\t\tfmt.Println(err)\n\t\t\t}\n\t\t\tfmt.Println(roles,rolecount)\n\t\t\t\n\t\t\t//create role\n\t\t\trolecreate, err := PermissionFlg.CreateRole(RoleCreation{Name: \"Manager\", Description: \"\", CreatedBy: 1})\n\t\t\tif err != nil {\n\t\t\t\t//handle error\n\t\t\t\tfmt.Println(err)\n\t\t\t}\n\t\t\tfmt.Println(rolecreate)\n\t\t\t\n\t\t\t//update role\n\t\t\troleupdate, err := PermissionFlg.UpdateRole(RoleCreation{Name: \"Manager\", Description: \"deportment of marketting\", CreatedBy: 1},3)\n\t\t\tif err != nil {\n\t\t\t\t//handle error\n\t\t\t\tfmt.Println(err)\n\t\t\t}\n\t\t\tfmt.Println(roleupdate)\n\t\t\t\n\t\t\t//delete role 1st param multiple delete , 2nd param single delete\n\t\t\tflg, err := PermissionFlg.DeleteRole([]int{}, 1)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tfmt.Println(flg)\n\t\t\n\t\t}\n\n\t}\t\n\n\t```\n\n\n\n\n\t# Getting help\n\tIf you encounter a problem with the package,please refer [Please refer [(https://www.spurtcms.com/documentation/cms-admin)] or you can create a new Issue in this repo[https://github.com/spurtcms/team-roles/issues]. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fteam-roles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspurtcms%2Fteam-roles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fteam-roles/lists"}