i18n - docs translations (#21923)
Created by Github action <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21923?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions <github-actions@twenty.com>
This commit is contained in:
committed by
GitHub
parent
fa6d1394af
commit
82f6597dc3
@@ -50,6 +50,116 @@ export default defineRole({
|
||||
});
|
||||
```
|
||||
|
||||
## 행 수준 보안
|
||||
|
||||
오브젝트 및 필드 권한은 역할이 *어떤 오브젝트와 필드* 를 다룰 수 있는지를 결정합니다. **행 수준
|
||||
권한 프레디킷** 은 더 나아가 역할이 *어떤 레코드* 를 보고 작업할 수 있는지를 결정합니다. 예를 들어, 각 외부 사용자가 자신의 레코드만 볼 수 있는 셀프 서비스 역할 같은 경우입니다.
|
||||
|
||||
역할에 `rowLevelPermissionPredicates` 로 프레디킷을 선언합니다. 매니페스트의 나머지와 마찬가지로,
|
||||
각 프레디킷은 자체 `universalIdentifier` 를 가지고, 오브젝트와 필드를 각각의
|
||||
`universalIdentifier`, `operand`, 그리고 (선택적으로) 쿼리 시점에 값이 주입되는 workspaceMember 필드를 통해 참조합니다. 이렇게 하면 "레코드의 owner relation **is** 현재 workspace member이다"를 표현할 수 있습니다:
|
||||
|
||||
```ts src/roles/partner-role.ts
|
||||
import {
|
||||
defineRole,
|
||||
RowLevelPermissionPredicateOperand,
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
|
||||
} from 'twenty-sdk/define';
|
||||
|
||||
import { ACCOUNT_OWNER_FIELD_UNIVERSAL_IDENTIFIER } from '../fields/account-owner.field';
|
||||
|
||||
export default defineRole({
|
||||
universalIdentifier: 'c3c1dc2e-1a08-4de5-abb7-2139b3d99343',
|
||||
label: 'Partner',
|
||||
description: 'External partner — sees only its own records',
|
||||
canBeAssignedToUsers: true,
|
||||
objectPermissions: [
|
||||
{
|
||||
objectUniversalIdentifier:
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company.universalIdentifier,
|
||||
canReadObjectRecords: true,
|
||||
canUpdateObjectRecords: true,
|
||||
},
|
||||
],
|
||||
rowLevelPermissionPredicates: [
|
||||
{
|
||||
universalIdentifier: 'd0f0c1a2-3b4c-4d5e-8f60-111111111111',
|
||||
objectUniversalIdentifier:
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company.universalIdentifier,
|
||||
fieldUniversalIdentifier: ACCOUNT_OWNER_FIELD_UNIVERSAL_IDENTIFIER,
|
||||
operand: RowLevelPermissionPredicateOperand.IS,
|
||||
workspaceMemberFieldUniversalIdentifier:
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workspaceMember.fields.id
|
||||
.universalIdentifier,
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
프레디킷은 매니페스트에 함께 포함되어 배포되므로, 모든 설치와 업그레이드 시 역할과 함께 생성·업데이트·제거됩니다. 동기화를 유지하기 위한 별도의 설치 후 단계는 필요하지 않습니다.
|
||||
|
||||
### 프레디킷을 그룹과 결합하기
|
||||
|
||||
기본적으로 역할의 프레디킷은 `AND`로 결합됩니다. 일부를 `OR`로 결합하거나(또는 논리를 중첩하려면) `rowLevelPermissionPredicateGroups` 항목을 선언하고 각 프레디킷이 `predicateGroupUniversalIdentifier`를 통해 해당 그룹을 가리키도록 설정합니다. 이 역할은 파트너가 자신이 **소유한** 또는 **담당자**인 기회(Opportunity)를 볼 수 있도록 허용합니다:
|
||||
|
||||
```ts src/roles/partner-opportunities-role.ts
|
||||
import {
|
||||
defineRole,
|
||||
RowLevelPermissionPredicateGroupLogicalOperator,
|
||||
RowLevelPermissionPredicateOperand,
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
|
||||
} from 'twenty-sdk/define';
|
||||
|
||||
const OPPORTUNITY = STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity;
|
||||
const CURRENT_MEMBER =
|
||||
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workspaceMember.fields.id
|
||||
.universalIdentifier;
|
||||
|
||||
export default defineRole({
|
||||
universalIdentifier: 'b2a1c0d9-8e7f-4a6b-9c5d-222222222222',
|
||||
label: 'Partner (opportunities)',
|
||||
canBeAssignedToUsers: true,
|
||||
objectPermissions: [
|
||||
{
|
||||
objectUniversalIdentifier: OPPORTUNITY.universalIdentifier,
|
||||
canReadObjectRecords: true,
|
||||
},
|
||||
],
|
||||
rowLevelPermissionPredicateGroups: [
|
||||
{
|
||||
universalIdentifier: 'c3b2a1d0-9f8e-4b7a-8d6c-333333333333',
|
||||
objectUniversalIdentifier: OPPORTUNITY.universalIdentifier,
|
||||
logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator.OR,
|
||||
},
|
||||
],
|
||||
rowLevelPermissionPredicates: [
|
||||
{
|
||||
universalIdentifier: 'd4c3b2a1-0e9f-4c8b-9e7d-444444444444',
|
||||
objectUniversalIdentifier: OPPORTUNITY.universalIdentifier,
|
||||
fieldUniversalIdentifier: OPPORTUNITY.fields.owner.universalIdentifier,
|
||||
operand: RowLevelPermissionPredicateOperand.IS,
|
||||
workspaceMemberFieldUniversalIdentifier: CURRENT_MEMBER,
|
||||
predicateGroupUniversalIdentifier: 'c3b2a1d0-9f8e-4b7a-8d6c-333333333333',
|
||||
},
|
||||
{
|
||||
universalIdentifier: 'e5d4c3b2-1f0e-4d9c-8f8e-555555555555',
|
||||
objectUniversalIdentifier: OPPORTUNITY.universalIdentifier,
|
||||
fieldUniversalIdentifier:
|
||||
OPPORTUNITY.fields.pointOfContact.universalIdentifier,
|
||||
operand: RowLevelPermissionPredicateOperand.IS,
|
||||
workspaceMemberFieldUniversalIdentifier: CURRENT_MEMBER,
|
||||
predicateGroupUniversalIdentifier: 'c3b2a1d0-9f8e-4b7a-8d6c-333333333333',
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
노트:
|
||||
|
||||
* 모든 프레디킷과 그룹에 안정적인 `universalIdentifier`(임의의 uuid)를 부여하세요. 이는 업그레이드 전반에 걸쳐 엔티티의 키로 사용되며, 프레디킷은 이를 통해 그룹을 참조합니다.
|
||||
* 프레디킷은 앱에서 소유한 오브젝트와 필드뿐만 아니라 Twenty의 표준 오브젝트가 소유한 오브젝트와 필드를 참조할 수 있습니다.
|
||||
* 행 수준 보안은 이를 포함한 플랜의 워크스페이스에 대해 적용됩니다. 다른 플랜에서도 프레디킷은 계속 동기화되지만, 적용되지는 않습니다.
|
||||
|
||||
## 기본 함수 역할
|
||||
|
||||
새 앱을 스캐폴딩하면, CLI가 `defineApplicationRole()`로 선언된 기본 역할 파일을 생성합니다:
|
||||
|
||||
Reference in New Issue
Block a user