{"id":21445772,"url":"https://github.com/sensenet/sn-security","last_synced_at":"2025-07-14T19:30:56.751Z","repository":{"id":46124079,"uuid":"73205922","full_name":"SenseNet/sn-security","owner":"SenseNet","description":"A powerful .Net component for managing permission entries in content repositories.","archived":false,"fork":false,"pushed_at":"2024-07-16T14:47:21.000Z","size":1030,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2024-11-10T02:25:11.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SenseNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security-messaging-rabbitmq.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-08T16:36:56.000Z","updated_at":"2024-07-15T22:43:26.000Z","dependencies_parsed_at":"2024-01-05T05:26:08.589Z","dependency_job_id":"f2aa0b85-b8cb-47a6-b855-40d3f4eca0ae","html_url":"https://github.com/SenseNet/sn-security","commit_stats":{"total_commits":59,"total_committers":7,"mean_commits":8.428571428571429,"dds":0.3389830508474576,"last_synced_commit":"307dcc15169ec4642f621ab541850f1ccae0bb55"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SenseNet%2Fsn-security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SenseNet%2Fsn-security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SenseNet%2Fsn-security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SenseNet%2Fsn-security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SenseNet","download_url":"https://codeload.github.com/SenseNet/sn-security/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225994885,"owners_count":17556830,"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-23T02:38:39.552Z","updated_at":"2024-11-23T02:38:40.095Z","avatar_url":"https://github.com/SenseNet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sensenet Security\r\n\r\n[![Security core](https://img.shields.io/nuget/v/SenseNet.Security.svg)](https://www.nuget.org/packages/SenseNet.Security)\r\n[![EF/ data provider](https://img.shields.io/nuget/v/SenseNet.Security.EF6SecurityStore.svg)](https://www.nuget.org/packages/SenseNet.Security.EF6SecurityStore)\r\n[![MSMQ message provider](https://img.shields.io/nuget/v/SenseNet.Security.Messaging.Msmq.svg)](https://www.nuget.org/packages/SenseNet.Security.Messaging.Msmq)\r\n\r\nA powerful and fast .Net component for managing **permission entries** in structured content repositories.\r\n\r\nThe permission layer of [sensenet](https://github.com/SenseNet/sensenet) is built on top of this library, so it is a well-tested, robust and scalable option for providing permission features in large projects.\r\n\r\nPermission entries and user-group relationships are stored in a database that can be replaced with a **custom db provider**. The built-in db provider is for *Entity Framework*.\r\n\r\n## Main features\r\n### Entities\r\nThe security component has an API for maintaining an entity structure (parent-child relationships), so it is ideal and most effective for providing security functionality in environments where there is a tree structure.\r\n````csharp\r\n// register an entity in the security component\r\ncontext.CreateSecurityEntity(entityId, parentId, ownerId);\r\n````\r\n### Users and Groups\r\nUser-Group relationships are essential, because permissions are evaluated in a transitive way: permissions set for a group apply to its members too. Groups may have group members too.\r\n````csharp\r\ncontext.IsInGroup(memberId, groupId);\r\n````\r\n### Entries\r\nPermission entries (*Access Control Entries*) are lists of permissions defined on an entity for a user or group. The security component handles permissions as simple slots in the db, the permission types (e.g. Open or Save) are defined by the client application.\r\n````csharp\r\n// break permission inheritance, fluent API\r\ncontext.CreateAclEditor()\r\n\t.BreakInheritance(entityId1)\r\n\t.Allow(entityId2, identityId1, localOnly, PermissionType.Save)\r\n\t.Allow(entityId3, identityId2, localOnly, PermissionType.AddNew)\r\n\t.Apply();\r\n````\r\n## Evaluation\r\nPermission evaluation takes two things into account:\r\n- **tree structure**: permissions defined on the parent are applied on children (unless they are local-only).\r\n- **group memberships**: permissions set for a group apply to all group members.\r\n\r\nIt works similarly to *file system permissions*, in other words: *it works as you expect*.\r\n\r\n````csharp\r\n// permission check for a single item\r\nif (context.HasPermission(entityId, PermissionType.See)) \r\n{\r\n}\r\n````\r\n\r\n## Integration\r\n\r\nFor details on integrating it in a 3rd party application please visit the following article:\r\n- https://github.com/SenseNet/sensenet.github.io/blob/master/_docs/security-component.md\r\n\r\n# sensenet as a service (SNaaS) - use sensenet from the cloud\r\n\r\nFor a monthly subscription fee, we store all your content and data, relieving you of all maintenance-related tasks and installation, ensuring easy onboarding, easy updates, and patches.\r\n\r\nhttps://www.sensenet.com/pricing\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensenet%2Fsn-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensenet%2Fsn-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensenet%2Fsn-security/lists"}