@fto-consult/expo-ui 8.15.3 → 8.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.15.3",
3
+ "version": "8.16.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -54,12 +54,16 @@ const PermLines = React.forwardRef(({user,gridProps,defaultActions:cDefaultActio
54
54
  const content = React.useMemo(()=>{
55
55
  const content = [];
56
56
  Object.map(tables,(table,tableName)=>{
57
- if(!isObj(table) || !isObj(table.perms)) return null;
57
+ if(!isObj(table)) return null;
58
+ const tablePerms = typeof table.perms =="function"? table.perms({user,isMasterAdmin:isUserMasterAdmin,table,tables}) : table.perms;
59
+ if(!isObj(tablePerms)){
60
+ return null;
61
+ }
58
62
  tableName = defaultStr(table.tableName,table.table,tableName).toLowerCase().trim();
59
63
  const text = defaultStr(table.text,table.label)
60
64
  const resource = getTableDataPermResourcePrefix(tableName);
61
65
  const perms = {};
62
- Object.map(table.perms,(perm,i)=>{
66
+ Object.map(tablePerms,(perm,i)=>{
63
67
  const iLower = i.toLowerCase();
64
68
  if(iLower == 'defaultactions' || iLower =='defaultaction'){
65
69
  perms.defaultActions = perm;