Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert change to account auth #4727

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/domain/space/account/account.service.authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,32 +282,18 @@ export class AccountAuthorizationService {
accountHostManage.cascade = true;
newRules.push(accountHostManage);

const vcCampaignCredential: ICredentialDefinition = {
type: AuthorizationCredential.VC_CAMPAIGN,
resourceID: '',
};

const betaTesterCredential: ICredentialDefinition = {
type: AuthorizationCredential.BETA_TESTER,
resourceID: '',
};

const createResourcesUnderAccountCredentials = [
vcCampaignCredential,
betaTesterCredential,
];
// If the user is a beta tester or part of VC campaign then can create the resources
const createSpace = this.authorizationPolicyService.createCredentialRule(
[AuthorizationPrivilege.CREATE_SPACE],
createResourcesUnderAccountCredentials,
[...hostCredentials],
CREDENTIAL_RULE_PLATFORM_CREATE_SPACE
);
createSpace.cascade = false;
newRules.push(createSpace);

const createVC = this.authorizationPolicyService.createCredentialRule(
[AuthorizationPrivilege.CREATE_VIRTUAL_CONTRIBUTOR],
createResourcesUnderAccountCredentials,
[...hostCredentials],
CREDENTIAL_RULE_PLATFORM_CREATE_VC
);
createVC.cascade = false;
Expand All @@ -316,7 +302,7 @@ export class AccountAuthorizationService {
const createInnovationPack =
this.authorizationPolicyService.createCredentialRule(
[AuthorizationPrivilege.CREATE_INNOVATION_PACK],
createResourcesUnderAccountCredentials,
[...hostCredentials],
CREDENTIAL_RULE_PLATFORM_CREATE_INNOVATION_PACK
);
createInnovationPack.cascade = false;
Expand Down