-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(permission): add dynamic permission managemnent support.
- Loading branch information
Showing
68 changed files
with
2,909 additions
and
326 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
apps/vue/src/api/permission-management/definitions/groups/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defHttp } from '/@/utils/http/axios'; | ||
import { | ||
PermissionGroupDefinitionDto, | ||
PermissionGroupDefinitionCreateDto, | ||
PermissionGroupDefinitionUpdateDto, | ||
PermissionGroupDefinitionGetListInput, | ||
} from './model'; | ||
|
||
export const CreateAsyncByInput = (input: PermissionGroupDefinitionCreateDto) => { | ||
return defHttp.post<PermissionGroupDefinitionDto>({ | ||
url: '/api/permission-management/definitions/groups', | ||
data: input, | ||
}); | ||
}; | ||
|
||
export const DeleteAsyncByName = (name: string) => { | ||
return defHttp.delete<void>({ | ||
url: `/api/permission-management/definitions/groups/${name}`, | ||
}); | ||
}; | ||
|
||
export const GetAsyncByName = (name: string) => { | ||
return defHttp.get<PermissionGroupDefinitionDto>({ | ||
url: `/api/permission-management/definitions/groups/${name}`, | ||
}); | ||
}; | ||
|
||
export const GetListAsyncByInput = (input: PermissionGroupDefinitionGetListInput) => { | ||
return defHttp.get<ListResultDto<PermissionGroupDefinitionDto>>({ | ||
url: '/api/permission-management/definitions/groups', | ||
params: input, | ||
}); | ||
}; | ||
|
||
export const UpdateAsyncByNameAndInput = (name: string, input: PermissionGroupDefinitionUpdateDto) => { | ||
return defHttp.put<PermissionGroupDefinitionDto>({ | ||
url: `/api/permission-management/definitions/groups/${name}`, | ||
data: input, | ||
}); | ||
}; |
19 changes: 19 additions & 0 deletions
19
apps/vue/src/api/permission-management/definitions/groups/model/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
interface PermissionGroupDefinitionCreateOrUpdateDto extends IHasExtraProperties { | ||
displayName: string; | ||
} | ||
|
||
export interface PermissionGroupDefinitionCreateDto extends PermissionGroupDefinitionCreateOrUpdateDto { | ||
name: string; | ||
} | ||
|
||
export interface PermissionGroupDefinitionDto extends IHasExtraProperties { | ||
name: string; | ||
displayName: string; | ||
isStatic: boolean; | ||
} | ||
|
||
export interface PermissionGroupDefinitionGetListInput { | ||
filter?: string; | ||
} | ||
|
||
export type PermissionGroupDefinitionUpdateDto = PermissionGroupDefinitionCreateOrUpdateDto; |
40 changes: 40 additions & 0 deletions
40
apps/vue/src/api/permission-management/definitions/permissions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defHttp } from '/@/utils/http/axios'; | ||
import { | ||
PermissionDefinitionDto, | ||
PermissionDefinitionCreateDto, | ||
PermissionDefinitionUpdateDto, | ||
PermissionDefinitionGetListInput, | ||
} from './model'; | ||
|
||
export const CreateAsyncByInput = (input: PermissionDefinitionCreateDto) => { | ||
return defHttp.post<PermissionDefinitionDto>({ | ||
url: '/api/permission-management/definitions', | ||
data: input, | ||
}); | ||
}; | ||
|
||
export const DeleteAsyncByName = (name: string) => { | ||
return defHttp.delete<void>({ | ||
url: `/api/permission-management/definitions/${name}`, | ||
}); | ||
}; | ||
|
||
export const GetAsyncByName = (name: string) => { | ||
return defHttp.get<PermissionDefinitionDto>({ | ||
url: `/api/permission-management/definitions/${name}`, | ||
}); | ||
}; | ||
|
||
export const GetListAsyncByInput = (input: PermissionDefinitionGetListInput) => { | ||
return defHttp.get<ListResultDto<PermissionDefinitionDto>>({ | ||
url: '/api/permission-management/definitions', | ||
params: input, | ||
}); | ||
}; | ||
|
||
export const UpdateAsyncByNameAndInput = (name: string, input: PermissionDefinitionUpdateDto) => { | ||
return defHttp.put<PermissionDefinitionDto>({ | ||
url: `/api/permission-management/definitions/${name}`, | ||
data: input, | ||
}); | ||
}; |
36 changes: 36 additions & 0 deletions
36
apps/vue/src/api/permission-management/definitions/permissions/model/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export enum MultiTenancySides { | ||
Tenant = 0x1, | ||
Host = 0x2, | ||
Both = 0x3, | ||
} | ||
|
||
interface PermissionDefinitionCreateOrUpdateDto extends IHasExtraProperties { | ||
displayName: string; | ||
parentName?: string; | ||
isEnabled: boolean; | ||
providers: string[]; | ||
stateCheckers: string; | ||
} | ||
|
||
export interface PermissionDefinitionCreateDto extends PermissionDefinitionCreateOrUpdateDto { | ||
groupName: string; | ||
name: string; | ||
} | ||
|
||
export interface PermissionDefinitionDto extends IHasExtraProperties { | ||
groupName: string; | ||
name: string; | ||
displayName: string; | ||
parentName?: string; | ||
isEnabled: boolean; | ||
isStatic: boolean; | ||
providers: string[]; | ||
stateCheckers: string; | ||
} | ||
|
||
export interface PermissionDefinitionGetListInput { | ||
filter?: string; | ||
groupName?: string; | ||
} | ||
|
||
export type PermissionDefinitionUpdateDto = PermissionDefinitionCreateOrUpdateDto; |
11 changes: 3 additions & 8 deletions
11
...c/api/permission-management/permission.ts → ...ermission-management/permissions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ssion-management/model/permissionModel.ts → ...ion-management/permissions/model/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.