@@ -23,25 +23,34 @@ const ApplicationDetailRouter = {
2323 parentName : 'ApplicationDetail' ,
2424 permission : [
2525 ( ) => {
26- const to : any = get_next_route ( )
27- return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' ) } ,
28-
29- RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ,
30- PermissionConst . APPLICATION_OVERVIEW_READ . getWorkspacePermissionWorkspaceManageRole ,
26+ const to : any = get_next_route ( )
27+ if ( to . params . from == 'resource-management' ) { } else {
28+ return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' )
29+ }
30+ } ,
31+ ( ) => {
32+ const to : any = get_next_route ( )
33+ if ( to . params . from == 'resource-management' ) { } else { return RoleConst . WORKSPACE_MANAGE . getWorkspaceRole }
34+ } ,
3135 ( ) => {
3236 const to : any = get_next_route ( )
33- return PermissionConst . APPLICATION_OVERVIEW_READ . getApplicationWorkspaceResourcePermission (
34- to ? to . params . id : '' ,
35- )
37+ if ( to . params . from == 'resource-management' ) { } else { return PermissionConst . APPLICATION_OVERVIEW_READ . getWorkspacePermissionWorkspaceManageRole }
3638 } ,
3739 ( ) => {
3840 const to : any = get_next_route ( )
39- if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
41+ if ( to . params . from == 'resource-management' ) { } else {
42+ return PermissionConst . APPLICATION_OVERVIEW_READ . getApplicationWorkspaceResourcePermission (
43+ to ? to . params . id : '' ,
44+ )
45+ }
4046 } ,
4147 ( ) => {
4248 const to : any = get_next_route ( )
43- console . log ( 'ss' , to )
44- if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_OVERVIEW_READ }
49+ if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
50+ } ,
51+ ( ) => {
52+ const to : any = get_next_route ( )
53+ if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_OVERVIEW_READ }
4554 } ,
4655 ]
4756 } ,
@@ -59,23 +68,38 @@ const ApplicationDetailRouter = {
5968 parentName : 'ApplicationDetail' ,
6069 permission : [
6170 ( ) => {
62- const to : any = get_next_route ( )
63- return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' ) } ,
64- RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ,
65- PermissionConst . APPLICATION_EDIT . getWorkspacePermissionWorkspaceManageRole ,
71+ const to : any = get_next_route ( )
72+ if ( to . params . from == 'resource-management' ) { } else {
73+ return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' )
74+ }
75+ } ,
6676 ( ) => {
6777 const to : any = get_next_route ( )
68- return PermissionConst . APPLICATION_EDIT . getApplicationWorkspaceResourcePermission (
69- to ? to . params . id : '' ,
70- )
78+ if ( to . params . from == 'resource-management' ) { } else {
79+ return RoleConst . WORKSPACE_MANAGE . getWorkspaceRole
80+ }
7181 } ,
7282 ( ) => {
7383 const to : any = get_next_route ( )
74- if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
84+ if ( to . params . from == 'resource-management' ) { } else {
85+ return PermissionConst . APPLICATION_EDIT . getWorkspacePermissionWorkspaceManageRole
86+ }
7587 } ,
76- ( ) => {
88+ ( ) => {
89+ const to : any = get_next_route ( )
90+ if ( to . params . from == 'resource-management' ) { } else {
91+ return PermissionConst . APPLICATION_EDIT . getApplicationWorkspaceResourcePermission (
92+ to ? to . params . id : '' ,
93+ )
94+ }
95+ } ,
96+ ( ) => {
97+ const to : any = get_next_route ( )
98+ if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
99+ } ,
100+ ( ) => {
77101 const to : any = get_next_route ( )
78- if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_EDIT }
102+ if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_EDIT }
79103 } ,
80104 ]
81105 } ,
@@ -93,21 +117,34 @@ const ApplicationDetailRouter = {
93117 parentName : 'ApplicationDetail' ,
94118 permission : [
95119 ( ) => {
96- const to : any = get_next_route ( )
97- return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'AND' ) } ,
98- new ComplexPermission ( [ RoleConst . WORKSPACE_MANAGE . getWorkspaceRole , ] , [ PermissionConst . APPLICATION_ACCESS_READ . getWorkspacePermissionWorkspaceManageRole ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' ) ,
99- new ComplexPermission ( [ ] , [ ( ) => {
100120 const to : any = get_next_route ( )
101- return PermissionConst . APPLICATION_ACCESS_READ . getApplicationWorkspaceResourcePermission (
102- to ? to . params . id : '' , )
103- } ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' ) ,
121+ if ( to . params . from == 'resource-management' ) { } else {
122+ return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'AND' )
123+ }
124+ } ,
104125 ( ) => {
105126 const to : any = get_next_route ( )
106- if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
127+ if ( to . params . from == 'resource-management' ) { } else {
128+ return new ComplexPermission ( [ RoleConst . WORKSPACE_MANAGE . getWorkspaceRole , ] , [ PermissionConst . APPLICATION_ACCESS_READ . getWorkspacePermissionWorkspaceManageRole ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
129+ }
107130 } ,
108- ( ) => {
131+ ( ) => {
109132 const to : any = get_next_route ( )
110- if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_ACCESS_READ }
133+ if ( to . params . from == 'resource-management' ) { } else {
134+ return new ComplexPermission ( [ ] , [ ( ) => {
135+ const to : any = get_next_route ( )
136+ return PermissionConst . APPLICATION_ACCESS_READ . getApplicationWorkspaceResourcePermission (
137+ to ? to . params . id : '' , )
138+ } ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
139+ }
140+ } ,
141+ ( ) => {
142+ const to : any = get_next_route ( )
143+ if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
144+ } ,
145+ ( ) => {
146+ const to : any = get_next_route ( )
147+ if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_ACCESS_READ }
111148 } ,
112149 ]
113150 } ,
@@ -126,22 +163,31 @@ const ApplicationDetailRouter = {
126163 resourceType : SourceTypeEnum . APPLICATION ,
127164 permission : [
128165 ( ) => {
129- const to : any = get_next_route ( )
130- return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'AND' ) } ,
131- new ComplexPermission ( [ RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ] , [ PermissionConst . APPLICATION_CHAT_USER_READ . getWorkspacePermissionWorkspaceManageRole ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
132- ,
166+ const to : any = get_next_route ( )
167+ if ( to . params . from == 'resource-management' ) { } else {
168+ return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'AND' )
169+ }
170+ } ,
171+ ( ) => {
172+ const to : any = get_next_route ( )
173+ if ( to . params . from == 'resource-management' ) { } else {
174+ return new ComplexPermission ( [ RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ] , [ PermissionConst . APPLICATION_CHAT_USER_READ . getWorkspacePermissionWorkspaceManageRole ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
175+ }
176+ } ,
133177 ( ) => {
134178 const to : any = get_next_route ( )
135- return new ComplexPermission ( [ ] , [ PermissionConst . APPLICATION_CHAT_USER_READ . getApplicationWorkspaceResourcePermission (
136- to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
179+ if ( to . params . from == 'resource-management' ) { } else {
180+ return new ComplexPermission ( [ ] , [ PermissionConst . APPLICATION_CHAT_USER_READ . getApplicationWorkspaceResourcePermission (
181+ to ? to . params . id : '' , ) ] , [ EditionConst . IS_EE , EditionConst . IS_PE ] , 'OR' )
182+ }
137183 } ,
138184 ( ) => {
139185 const to : any = get_next_route ( )
140- if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
186+ if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
141187 } ,
142- ( ) => {
188+ ( ) => {
143189 const to : any = get_next_route ( )
144- if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_CHAT_USER_READ }
190+ if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_CHAT_USER_READ }
145191 } ,
146192 ]
147193 } ,
@@ -159,23 +205,38 @@ const ApplicationDetailRouter = {
159205 parentName : 'ApplicationDetail' ,
160206 permission : [
161207 ( ) => {
162- const to : any = get_next_route ( )
163- return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' ) } ,
164- RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ,
165- PermissionConst . APPLICATION_CHAT_LOG_READ . getWorkspacePermissionWorkspaceManageRole ,
208+ const to : any = get_next_route ( )
209+ if ( to . params . from == 'resource-management' ) { } else {
210+ return new ComplexPermission ( [ RoleConst . USER ] , [ PermissionConst . APPLICATION . getApplicationWorkspaceResourcePermission ( to ? to . params . id : '' , ) ] , [ ] , 'AND' )
211+ }
212+ } ,
213+ ( ) => {
214+ const to : any = get_next_route ( )
215+ if ( to . params . from == 'resource-management' ) { } else {
216+ return RoleConst . WORKSPACE_MANAGE . getWorkspaceRole
217+ }
218+ } ,
219+ ( ) => {
220+ const to : any = get_next_route ( )
221+ if ( to . params . from == 'resource-management' ) { } else {
222+ return PermissionConst . APPLICATION_CHAT_LOG_READ . getWorkspacePermissionWorkspaceManageRole
223+ }
224+ } ,
166225 ( ) => {
167226 const to : any = get_next_route ( )
168- return PermissionConst . APPLICATION_CHAT_LOG_READ . getApplicationWorkspaceResourcePermission (
169- to ? to . params . id : '' ,
170- )
227+ if ( to . params . from == 'resource-management' ) { } else {
228+ return PermissionConst . APPLICATION_CHAT_LOG_READ . getApplicationWorkspaceResourcePermission (
229+ to ? to . params . id : '' ,
230+ )
231+ }
171232 } ,
172233 ( ) => {
173234 const to : any = get_next_route ( )
174- if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
235+ if ( to . path . includes ( 'resource-management' ) ) { return RoleConst . ADMIN }
175236 } ,
176- ( ) => {
237+ ( ) => {
177238 const to : any = get_next_route ( )
178- if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_CHAT_LOG_READ }
239+ if ( to . path . includes ( 'resource-management' ) ) { return PermissionConst . RESOURCE_APPLICATION_CHAT_LOG_READ }
179240 } ,
180241 ]
181242 } ,
0 commit comments