<commit_before>package org.estatio.module.base.fixtures.security.perms.personas;

import org.apache.isis.applib.annotation.Programmatic;

import org.isisaddons.module.security.dom.permission.ApplicationPermissionMode;
import org.isisaddons.module.security.dom.permission.ApplicationPermissionRule;
import org.isisaddons.module.security.seed.scripts.AbstractRoleAndPermissionsFixtureScript;

import org.estatio.module.base.dom.EstatioRole;

@Programmatic
public class EstatioCapexUserRoleAndPermissions extends AbstractRoleAndPermissionsFixtureScript {

    public static final String ROLE_NAME = EstatioRole.CAPEX_USER.getRoleName();

    public EstatioCapexUserRoleAndPermissions() {
        super(ROLE_NAME, "Estatio Capex user");
    }

    @Override
    protected void execute(final ExecutionContext executionContext) {
        newViewingPermission("org.estatio");
        newViewingPermission("org.estatio.app");
        newViewingPermission("org.estatio.dom");
        newViewingPermission("org.estatio.services");
        newViewingPermission("org.incode");
        newViewingPermission("org.estatio.webapp.services.other");
        newChangingPermission("org.estatio.module.capex");
        newChangingPermission("org.estatio.module.application.app.dashboard");
        newChangingPermission("org.estatio.module.asset.app.PropertyMenu#findProperties");
        newChangingPermission("org.estatio.module.charge.app.ChargeMenu#findCharge");
        newChangingPermission("org.estatio.module.party.app.PartyMenu#findParties");
        newChangingPermission("org.estatio.module.party.app.PersonMenu#findPerson");
    }

    private void newChangingPermission(String packageSuffix) {
        newPackagePermissions(
                ApplicationPermissionRule.ALLOW,
                ApplicationPermissionMode.CHANGING,
                packageSuffix);
    }

    private void newViewingPermission(String packageSuffix) {
        newPackagePermissions(
                ApplicationPermissionRule.ALLOW,
                ApplicationPermissionMode.VIEWING,
                packageSuffix);
    }
}
<commit_msg>ECP-831: corrects capex user permissions with respect to allowed actions<commit_after>package org.estatio.module.base.fixtures.security.perms.personas;

import org.apache.isis.applib.annotation.Programmatic;

import org.isisaddons.module.security.dom.permission.ApplicationPermissionMode;
import org.isisaddons.module.security.dom.permission.ApplicationPermissionRule;
import org.isisaddons.module.security.seed.scripts.AbstractRoleAndPermissionsFixtureScript;

import org.estatio.module.asset.app.PropertyMenu;
import org.estatio.module.base.dom.EstatioRole;
import org.estatio.module.charge.app.ChargeMenu;
import org.estatio.module.party.app.PartyMenu;
import org.estatio.module.party.app.PersonMenu;

@Programmatic
public class EstatioCapexUserRoleAndPermissions extends AbstractRoleAndPermissionsFixtureScript {

    public static final String ROLE_NAME = EstatioRole.CAPEX_USER.getRoleName();

    public EstatioCapexUserRoleAndPermissions() {
        super(ROLE_NAME, "Estatio Capex user");
    }

    @Override
    protected void execute(final ExecutionContext executionContext) {
        newViewingPermission("org.estatio");
        newViewingPermission("org.estatio.app");
        newViewingPermission("org.estatio.dom");
        newViewingPermission("org.estatio.services");
        newViewingPermission("org.incode");
        newViewingPermission("org.estatio.webapp.services.other");
        newChangingPermission("org.estatio.module.capex");
        newChangingPermission("org.estatio.module.application.app.dashboard");
        newActionPermission(PropertyMenu.class, "findProperties");
        newActionPermission(ChargeMenu.class, "findCharge");
        newActionPermission(PartyMenu.class, "findParties");
        newActionPermission(PersonMenu.class, "findPerson");
    }

    private void newChangingPermission(String packageSuffix) {
        newPackagePermissions(
                ApplicationPermissionRule.ALLOW,
                ApplicationPermissionMode.CHANGING,
                packageSuffix);
    }

    private void newViewingPermission(String packageSuffix) {
        newPackagePermissions(
                ApplicationPermissionRule.ALLOW,
                ApplicationPermissionMode.VIEWING,
                packageSuffix);
    }

    private void newActionPermission(Class clasz, String actionName) {
        newMemberPermissions(
                ApplicationPermissionRule.ALLOW,
                ApplicationPermissionMode.CHANGING,
                clasz,
                actionName
        );
    }
    
}

{'fraction_non_alphanumeric': 0.08863489324994608, 'fraction_numerical': 0.0006469700237222342, 'mean_word_length': 3.7374872318692542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2377280', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1244, 'n_words': 160}