refs #6085 aclMail back
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-11-29 07:33:49 +01:00
parent c7291e3367
commit 0186c2c806
5 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,7 @@
-- Definición de la tabla mailAliasACL
CREATE TABLE `account`.`mailAliasACL` (
`mailAliasFk` int(10) unsigned NOT NULL,
`roleFk` int(10) unsigned NOT NULL,
FOREIGN KEY (`mailAliasFk`) REFERENCES `account`.`mailAlias` (`id`),
FOREIGN KEY (`roleFk`) REFERENCES `account`.`role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

View File

@ -0,0 +1,33 @@
import ngModule from '../../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
constructor(...args) {
super(...args);
this.accessTypes = [
{name: '*'},
{name: 'READ'},
{name: 'WRITE'}
];
this.permissions = [
{name: 'ALLOW'},
{name: 'DENY'}
];
this.models = [];
for (let model in window.validations)
this.models.push({name: model});
this.acl = {
property: '*',
principalType: 'ROLE',
accessType: 'READ',
permission: 'ALLOW'
};
}
}
ngModule.component('vnAclMailCreate', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,4 @@
import './main';
import './index/';
import './create';
import './search-panel';

View File

@ -0,0 +1,15 @@
import ngModule from '../../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
onDelete(row) {
return this.$http.delete(`ACLs/${row.id}`)
.then(() => this.$.model.refresh())
.then(() => this.vnApp.showSuccess(this.$t('ACL removed')));
}
}
ngModule.component('vnAclMailIndex', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,18 @@
import ngModule from '../../module';
import ModuleMain from 'salix/components/module-main';
export default class ACL extends ModuleMain {
exprBuilder(param, value) {
switch (param) {
case 'search':
return {model: {like: `%${value}%`}};
default:
return {[param]: value};
}
}
}
ngModule.vnComponent('vnAclMailComponent', {
controller: ACL,
template: require('./index.html')
});