@urga-panel/ur-panels-core 1.0.17 → 1.0.18

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.
@@ -16,6 +16,7 @@ export type ProjectsPages = {
16
16
  service?: PageService;
17
17
  serviceRef: any;
18
18
  userGroup?: string;
19
+ onlyForGroup?: boolean;
19
20
  };
20
21
  };
21
22
  export type ProjectInfoOts = ServiceOts & {
@@ -45,7 +45,10 @@ export class ProjectInfoService extends Service {
45
45
  Object.entries(this.pages).forEach(([key, page]) => {
46
46
  if (page.showInMenu) {
47
47
  if (userGroup && userGroup == 'admin') {
48
- result[key] = page;
48
+ // If onlyForGroup is true, admin cannot see this page
49
+ if (page.onlyForGroup !== true) {
50
+ result[key] = page;
51
+ }
49
52
  }
50
53
  else {
51
54
  if (userGroup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urga-panel/ur-panels-core",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,6 +17,7 @@ export type ProjectsPages = {
17
17
  service?: PageService; // Optional service name for custom handling
18
18
  serviceRef: any;
19
19
  userGroup?: string; // Optional user group for access control
20
+ onlyForGroup?: boolean; // If true, only the specified userGroup can see this page (admin excluded)
20
21
  };
21
22
  }
22
23
 
@@ -85,7 +86,10 @@ export abstract class ProjectInfoService extends Service {
85
86
  Object.entries(this.pages).forEach(([key, page]) => {
86
87
  if (page.showInMenu) {
87
88
  if (userGroup && userGroup == 'admin') {
88
- result[key] = page;
89
+ // If onlyForGroup is true, admin cannot see this page
90
+ if (page.onlyForGroup !== true) {
91
+ result[key] = page;
92
+ }
89
93
  }
90
94
  else {
91
95
  if (userGroup) {