The basic idea is following: you will configure two descriptors covering the same region. You will also enable the PID in both descriptors, so these descriptors are not considered as overlapping because also PID will be used to check if there's a hit or not. So, you can configure access rights for each process ID separately.
There's Process ID register in the core which is used to check if there's a hit or not. Your SW just writes this register as needed.

Now let's say we have descriptor X and descriptor Y covering the same area.
Descriptor X is configured for PID 3 and descriptor Y for PID 4.
Default value of PID (for main task) is 0.
How to use it with tasks:
void task1(void) /* covered by descriptor(s) X */
{
// Set Process ID 3
__MTSPR(SPR_PID,3);
/* run your code */
// Set Process ID back to 0
__MTSPR(SPR_PID,0);
}
void task2(void) /* covered by descriptor(s) Y */
{
// Set Process ID 4
__MTSPR(SPR_PID,4);
/* run your code */
// Set Process ID back to 0
__MTSPR(SPR_PID,0);
}
I'm not really sure if this can be implemented to MBDT, please ask here:
https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/bd-p/mbdt
Regards,
Lukas