From 41dfa9f9a1662159a30b1623b167a13d7efa5381 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 21 Feb 2018 09:28:17 +0100 Subject: [PATCH] creacion de ACL en diferentes modelos --- client/item/routes.json | 7 +++---- client/item/src/list/item-product.html | 7 +++++-- client/item/src/list/list.html | 4 ++-- client/item/src/list/preview.svg | 11 +++++++++++ client/item/src/list/style.css | 4 ++-- services/item/common/models/expence.json | 10 +++++++++- services/item/common/models/genus.json | 10 +++++++++- services/item/common/models/ink.json | 10 +++++++++- services/item/common/models/intrastat.json | 10 +++++++++- services/item/common/models/item-botanical.json | 10 +++++++++- services/item/common/models/item-type.json | 10 +++++++++- services/item/common/models/itemLog.json | 10 +++++++++- services/item/common/models/origin.json | 10 +++++++++- services/item/common/models/producer.json | 10 +++++++++- services/item/common/models/specie.json | 10 +++++++++- services/item/common/models/tag.json | 10 +++++++++- services/item/common/models/tax-class.json | 10 +++++++++- services/item/common/models/tax-code.json | 10 +++++++++- services/item/common/models/tax-type.json | 10 +++++++++- 19 files changed, 149 insertions(+), 24 deletions(-) create mode 100644 client/item/src/list/preview.svg diff --git a/client/item/routes.json b/client/item/routes.json index b3941d555..aa594234a 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -13,8 +13,7 @@ { "url": "/list", "state": "item.index", - "component": "vn-item-list", - "acl": ["developer"] + "component": "vn-item-list" }, { "url": "/create", @@ -36,8 +35,8 @@ }, "menu": { "description": "Basic data", - "icon": "folder" - } + "icon": "folder", + }, }, { "url" : "/tags", diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 4fde108fd..4b2ddcec6 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -1,14 +1,17 @@ - + - +
Id: {{$ctrl.item.id}}
Name: {{$ctrl.item.name}}
Description: {{$ctrl.item.description}}
Size: {{$ctrl.item.size}}
Type: {{$ctrl.item.itemType.name}}
+ + preview +
diff --git a/client/item/src/list/list.html b/client/item/src/list/list.html index b3bee2570..d41a15c2a 100644 --- a/client/item/src/list/list.html +++ b/client/item/src/list/list.html @@ -13,9 +13,9 @@ - + - + diff --git a/client/item/src/list/preview.svg b/client/item/src/list/preview.svg new file mode 100644 index 000000000..5d56b5f34 --- /dev/null +++ b/client/item/src/list/preview.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/client/item/src/list/style.css b/client/item/src/list/style.css index ca53151b9..dbf7aa1ac 100644 --- a/client/item/src/list/style.css +++ b/client/item/src/list/style.css @@ -1,12 +1,12 @@ vn-item-product { display: block; } -a.item-product-link { +vn-auto.item-product-link { display: block; text-decoration: none; color: inherit; } -a.item-product-link:hover { +vn-auto.item-product-link:hover { color: white; background-color: #424242; } diff --git a/services/item/common/models/expence.json b/services/item/common/models/expence.json index a8bf47569..79af34988 100644 --- a/services/item/common/models/expence.json +++ b/services/item/common/models/expence.json @@ -25,5 +25,13 @@ "model": "TaxType", "foreignKey": "taxTypeFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/genus.json b/services/item/common/models/genus.json index 4f269200b..1026e6f05 100644 --- a/services/item/common/models/genus.json +++ b/services/item/common/models/genus.json @@ -24,5 +24,13 @@ "change_date_time": { "type": "date" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/ink.json b/services/item/common/models/ink.json index 7b8647369..04117aa3b 100644 --- a/services/item/common/models/ink.json +++ b/services/item/common/models/ink.json @@ -18,5 +18,13 @@ "showOrder": { "type": "number" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/intrastat.json b/services/item/common/models/intrastat.json index 38347031d..e536e2581 100644 --- a/services/item/common/models/intrastat.json +++ b/services/item/common/models/intrastat.json @@ -27,5 +27,13 @@ "model": "TaxCode", "foreignKey": "taxCodeFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/item-botanical.json b/services/item/common/models/item-botanical.json index 655f0d48c..a2bab397a 100644 --- a/services/item/common/models/item-botanical.json +++ b/services/item/common/models/item-botanical.json @@ -32,5 +32,13 @@ "model": "Specie", "foreignKey": "specieFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/item-type.json b/services/item/common/models/item-type.json index d72fdba69..eec3af490 100644 --- a/services/item/common/models/item-type.json +++ b/services/item/common/models/item-type.json @@ -18,5 +18,13 @@ "life": { "type": "Number" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/itemLog.json b/services/item/common/models/itemLog.json index 9198bcb25..4f784b74f 100644 --- a/services/item/common/models/itemLog.json +++ b/services/item/common/models/itemLog.json @@ -34,5 +34,13 @@ "model": "Account", "foreignKey": "userFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } diff --git a/services/item/common/models/origin.json b/services/item/common/models/origin.json index 9860d677f..c381600bf 100644 --- a/services/item/common/models/origin.json +++ b/services/item/common/models/origin.json @@ -18,5 +18,13 @@ "name": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/producer.json b/services/item/common/models/producer.json index 941b50842..81a36f8d1 100644 --- a/services/item/common/models/producer.json +++ b/services/item/common/models/producer.json @@ -15,5 +15,13 @@ "name": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/specie.json b/services/item/common/models/specie.json index c8f9818fc..afa669af3 100644 --- a/services/item/common/models/specie.json +++ b/services/item/common/models/specie.json @@ -31,5 +31,13 @@ "model": "Genus", "foreignKey": "genus_id" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tag.json b/services/item/common/models/tag.json index 3a2097f97..0df56ef10 100644 --- a/services/item/common/models/tag.json +++ b/services/item/common/models/tag.json @@ -26,5 +26,13 @@ "unit": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } diff --git a/services/item/common/models/tax-class.json b/services/item/common/models/tax-class.json index d5746d699..46bcba87e 100644 --- a/services/item/common/models/tax-class.json +++ b/services/item/common/models/tax-class.json @@ -18,5 +18,13 @@ "code": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tax-code.json b/services/item/common/models/tax-code.json index d2c803ea5..dfd69139e 100644 --- a/services/item/common/models/tax-code.json +++ b/services/item/common/models/tax-code.json @@ -42,5 +42,13 @@ "model": "Link", "foreignKey": "linkFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tax-type.json b/services/item/common/models/tax-type.json index e8573156d..4e30446b0 100644 --- a/services/item/common/models/tax-type.json +++ b/services/item/common/models/tax-type.json @@ -31,5 +31,13 @@ "model": "Country", "foreignKey": "countryFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file