Skip to content

Commit

Permalink
Merge pull request #4727 from alkem-io/authFix
Browse files Browse the repository at this point in the history
revert change to account auth
  • Loading branch information
Comoque1 authored Nov 22, 2024
2 parents d49affc + 9357964 commit c2fdce3
Showing 1 changed file with 3 additions and 17 deletions.
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

0 comments on commit c2fdce3

Please sign in to comment.