mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-09-14 19:02:35 +00:00
User Permissions Modal
This commit is contained in:
@@ -124,7 +124,7 @@ export async function post({ url, params, data, noAuth }: PostArgs, abortControl
|
||||
interface PutArgs {
|
||||
url: string;
|
||||
params?: queryString.StringifiableRecord;
|
||||
data?: Record<string, unknown>;
|
||||
data?: Record<string, any>;
|
||||
}
|
||||
export async function put({ url, params, data }: PutArgs, abortController?: AbortController) {
|
||||
const apiUrl = buildUrl({ url, params });
|
||||
|
@@ -38,6 +38,7 @@ export * from "./models";
|
||||
export * from "./refreshToken";
|
||||
export * from "./renewCertificate";
|
||||
export * from "./responseTypes";
|
||||
export * from "./setPermissions";
|
||||
export * from "./testHttpCertificate";
|
||||
export * from "./toggleDeadHost";
|
||||
export * from "./toggleProxyHost";
|
||||
|
@@ -5,10 +5,10 @@ export interface AppVersion {
|
||||
}
|
||||
|
||||
export interface UserPermissions {
|
||||
id: number;
|
||||
createdOn: string;
|
||||
modifiedOn: string;
|
||||
userId: number;
|
||||
id?: number;
|
||||
createdOn?: string;
|
||||
modifiedOn?: string;
|
||||
userId?: number;
|
||||
visibility: string;
|
||||
proxyHosts: string;
|
||||
redirectionHosts: string;
|
||||
|
17
frontend/src/api/backend/setPermissions.ts
Normal file
17
frontend/src/api/backend/setPermissions.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as api from "./base";
|
||||
import type { UserPermissions } from "./models";
|
||||
|
||||
export async function setPermissions(
|
||||
userId: number,
|
||||
data: UserPermissions,
|
||||
abortController?: AbortController,
|
||||
): Promise<boolean> {
|
||||
// Remove readonly fields
|
||||
return await api.put(
|
||||
{
|
||||
url: `/users/${userId}/permissions`,
|
||||
data,
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user