Copy Table Permissions to View with Identical colums

Hardus

Member
I created a couple of views based on queries like sale processed and sale not processed, clients needing an invoice etc. Is there any way already to copy the permissions from the main table over to the views. I copied the fields settings over but the permissions I still need to set by hand on each view. All views has the same amount of columns as the main table they are based on.

You are using DaDaBIK version 9.3-Monterosso enterprise, installed on 06-24-2019 (installation code: 0), the latest version of DaDaBIK is

PHP Version: 7.2.15-0ubuntu0.18.04.1

mysql version: 5.7.25-0ubuntu0.18.04.2

Web server: Apache/2.4.29 (Ubuntu)

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
 

eugenio

Administrator
Staff member
Hello,
at the moment there isn't any copy permissions feature that works from one table/view to another, you can only copy from a group to another group .... but yes, what you suggest would be useful.

Maybe it's useful to know how permissions are represented in the dadabik_permissions tab, so you could maybe copy the permissions through some sql queries. Let's say you have a table "customers" with two fields: id and name. In the dadabik_permissions table, the records that represent the permissions are all the ones having:

object_type: table and object: customers
object_type: field and object: customers.id
object_type: field and object: customers.desc

so if you manage to replicate these data also for the view customers2 (having the same schema as customer),

object_type: table and object: customers2
object_type: field and object: customers2.id
object_type: field and object: customers2.desc

you have copied the permissions. Object_type, object and id_permissions are the only columns that need to be changed.

Best,
 
Top