mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
revert modify after rebase
This commit is contained in:
committed by
Eugenio Romano
parent
e1d1e647c6
commit
cfa8a222f0
@@ -8,8 +8,6 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
module.exports = {
|
||||
|
||||
resolveLoader: {
|
||||
|
@@ -128,27 +128,58 @@ export * from './src/models/permissions.enum';
|
||||
export * from './src/models/site.model';
|
||||
export * from './src/models/product-version.model';
|
||||
|
||||
export * from './src/models/index';
|
||||
// Old deprecated import
|
||||
import { AuthenticationService as AlfrescoAuthenticationService } from './src/services/authentication.service';
|
||||
import { TranslationService as AlfrescoTranslationService } from './src/services/translation.service';
|
||||
export { AuthenticationService as AlfrescoAuthenticationService } from './src/services/authentication.service';
|
||||
export { TranslationService as AlfrescoTranslationService } from './src/services/translation.service';
|
||||
export * from './src/services/search.service';
|
||||
|
||||
export const ALFRESCO_CORE_PROVIDERS: any[] = [
|
||||
NotificationService,
|
||||
LogService,
|
||||
LogServiceMock,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoContentService,
|
||||
AlfrescoSettingsService,
|
||||
StorageService,
|
||||
CookieService,
|
||||
AlfrescoApiService,
|
||||
AlfrescoTranslateLoader,
|
||||
AlfrescoTranslationService,
|
||||
RenditionsService,
|
||||
ContentService,
|
||||
AuthGuard,
|
||||
AuthGuardEcm,
|
||||
AuthGuardBpm,
|
||||
...CONTEXT_MENU_PROVIDERS
|
||||
];
|
||||
export function providers() {
|
||||
return [
|
||||
UserPreferencesService,
|
||||
NotificationService,
|
||||
LogService,
|
||||
LogServiceMock,
|
||||
AuthenticationService,
|
||||
AlfrescoContentService,
|
||||
AlfrescoSettingsService,
|
||||
StorageService,
|
||||
CookieService,
|
||||
AlfrescoApiService,
|
||||
AlfrescoTranslateLoader,
|
||||
TranslationService,
|
||||
RenditionsService,
|
||||
ContentService,
|
||||
AuthGuard,
|
||||
AuthGuardEcm,
|
||||
AuthGuardBpm,
|
||||
ThumbnailService,
|
||||
UploadService,
|
||||
SearchService,
|
||||
|
||||
DeletedNodesApiService,
|
||||
FavoritesApiService,
|
||||
NodesApiService,
|
||||
PeopleApiService,
|
||||
SearchApiService,
|
||||
SharedLinksApiService,
|
||||
SitesApiService,
|
||||
DiscoveryApiService,
|
||||
|
||||
// Old deprecated import
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoAuthenticationService
|
||||
];
|
||||
}
|
||||
|
||||
export function obsoleteMdlDirectives() {
|
||||
return [
|
||||
MDLDirective,
|
||||
AlfrescoMdlMenuDirective,
|
||||
AlfrescoMdlTextFieldDirective
|
||||
];
|
||||
}
|
||||
|
||||
export function createTranslateLoader(http: Http, logService: LogService) {
|
||||
return new AlfrescoTranslateLoader(http, logService);
|
||||
|
@@ -102,20 +102,39 @@ export class AlfrescoContentService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a folder
|
||||
* @param name - the folder name
|
||||
* Check if the user has permissions on that node
|
||||
* @param MinimalNode - node to check allowableOperations
|
||||
* @param PermissionsEnum - create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
|
||||
*
|
||||
* @returns {boolean} has permission
|
||||
*/
|
||||
createFolder(relativePath: string, name: string, parentId?: string): Observable<FolderCreatedEvent> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, relativePath, parentId))
|
||||
.do(data => {
|
||||
this.folderCreated.next(<FolderCreatedEvent>{
|
||||
relativePath: relativePath,
|
||||
name: name,
|
||||
parentId: parentId,
|
||||
node: data
|
||||
});
|
||||
})
|
||||
.catch(err => this.handleError(err));
|
||||
hasPermission(node: any, permission: PermissionsEnum|string): boolean {
|
||||
let hasPermission = false;
|
||||
|
||||
if (this.hasAllowableOperations(node)) {
|
||||
if (permission && permission.startsWith('!')) {
|
||||
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission.replace('!', '')) ? false : true;
|
||||
} else {
|
||||
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission) ? true : false;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (permission && permission.startsWith('!')) {
|
||||
hasPermission = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasPermission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the node has the properties allowableOperations
|
||||
* @param MinimalNode - node to check allowableOperations
|
||||
*
|
||||
* @returns {boolean} has AllowableOperations
|
||||
*/
|
||||
hasAllowableOperations(node: any): boolean {
|
||||
return node && node.allowableOperations ? true : false;
|
||||
}
|
||||
|
||||
private handleError(error: any) {
|
||||
|
Reference in New Issue
Block a user