/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ import { Observable } from 'rxjs'; import { User } from '../models/User'; import LookupTable from '../models/LookupTable'; import { Site } from '../models/Site'; import { PagedArray } from '../models/PagedArray'; import PaginationOptions from '../models/PaginationOptions'; export declare function me(): Observable; export declare namespace me { var url: string; } export declare function create(user: Partial): Observable; export declare function update(user: Partial): Observable; export declare function trash(username: string): Observable; export declare function fetchAll( options?: Partial< PaginationOptions & { keyword?: string; } > ): Observable>; export declare function enable(username: string): Observable; export declare function enable(usernames: string[]): Observable; export declare function disable(username: string): Observable; export declare function disable(usernames: string[]): Observable; /** * Sets the password for the supplied username. Requires UPDATE_USERS permission. **/ export declare function setPassword(username: string, password: string): Observable; /** * Set a new password using a valid password reset token. **/ export declare function resetPasswordWithToken(token: string, password: string): Observable; /** * Set the password for the current user. **/ export declare function setMyPassword(username: string, currentPassword: string, newPassword: string): Observable; export declare function fetchByUsername(username: string): Observable; export declare function fetchRolesInSite(username: string, siteId: string): Observable; export declare function fetchMyRolesInSite(siteId: string): Observable; export declare function fetchRolesBySite(username?: string, sites?: Site[]): Observable>; export declare function fetchMyRolesBySite(sites?: Site[]): Observable>; export declare function fetchGlobalProperties(): Observable>; export declare function deleteGlobalProperties(...preferenceKeys: string[]): Observable>; export declare function fetchSiteProperties(siteId: string): Observable>; export declare function deleteSiteProperties(site: string, ...preferenceKeys: string[]): Observable>; export declare function setProperties( preferences: LookupTable, siteId?: string ): Observable>; export declare function deleteProperties(properties: string[], siteId?: string): Observable>; export declare function fetchMyPermissions(site: string): Observable; export declare function hasPermissions(site: string, ...permissions: string[]): Observable>; export declare function hasPermission(site: string, permission: string): Observable; export declare function fetchGlobalPermissions(): Observable; export declare function hasGlobalPermissions(...permissions: string[]): Observable>; export declare function hasGlobalPermission(permission: string): Observable;