1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2024-12-01 02:32:18 +02:00

Merge pull request #1077 from 1C-Company/bugfix/815-right-set-full

Проверка: right-... не находит ошибку для роли с включением по умолчанию #815 #580
This commit is contained in:
Dmitriy Marmyshev 2022-07-27 11:06:39 +03:00 committed by GitHub
commit 132c3d2905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 765 additions and 137 deletions

View File

@ -76,6 +76,7 @@
- Ложное срабатывание проверки: statement-type-change для типов общего модуля #994
- Некорректное сообщение об ошибке в строгих типах. Не существует типа "Таблица" #1055
- Ложное сообщение об ошибке о неиспользовании составных типов для стандартных объектов метаданных #1069
- Проверка: right-... не находит ошибку для роли с включением по умолчанию #815
## 0.2.0

View File

@ -16,13 +16,17 @@ Bundle-Localization: plugin
Import-Package: com._1c.g5.v8.bm.core;version="[7.0.0,8.0.0)",
com._1c.g5.v8.bm.core.event;version="[2.1.0,3.0.0)",
com._1c.g5.v8.bm.integration;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.bm.index.emf;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bm.index.rights;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.core.platform;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.mcore;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.md;version="[17.0.0,18.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.platform.version;version="[2.0.0,3.0.0)",
com._1c.g5.v8.dt.rights.model;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.rights.model.util;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.rights.ui.editors.controllers;version="[4.0.0,5.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.e1c.g5.v8.dt.check;version="[2.0.0,3.0.0)",

View File

@ -25,15 +25,15 @@
</category>
<check
category="com.e1c.v8codestyle.right"
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteracitveDelete">
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteractiveDelete">
</check>
<check
category="com.e1c.v8codestyle.right"
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteracitveDeletePredefinedData">
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteractiveDeletePredefinedData">
</check>
<check
category="com.e1c.v8codestyle.right"
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteracitveDeleteMarkedPredefinedData">
class="com.e1c.v8codestyle.internal.right.ExecutableExtensionFactory:com.e1c.v8codestyle.right.check.RightInteractiveDeleteMarkedPredefinedData">
</check>
<check
category="com.e1c.v8codestyle.right"

View File

@ -153,7 +153,7 @@ public class CorePlugin
{
try
{
return Guice.createInjector(new ExternalDependenciesModule(this));
return Guice.createInjector(new ServiceModule(), new ExternalDependenciesModule(this));
}
catch (Exception e)
{

View File

@ -14,8 +14,13 @@ package com.e1c.v8codestyle.internal.right;
import org.eclipse.core.runtime.Plugin;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IConfigurationProvider;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport;
import com._1c.g5.wiring.AbstractServiceAwareModule;
/**
@ -40,7 +45,14 @@ public class ExternalDependenciesModule
protected void doConfigure()
{
bind(IV8ProjectManager.class).toService();
bind(IResourceLookup.class).toService();
bind(IBmModelManager.class).toService();
bind(IBmRightsIndexManager.class).toService();
bind(IBmEmfIndexManager.class).toService();
bind(IConfigurationProvider.class).toService();
// XXX remove this when the IRightInfosService become OSGi service
bind(IRuntimeVersionSupport.class).toService();
}
}

View File

@ -0,0 +1,89 @@
/*******************************************************************************
* Copyright (C) 2022, 1C-Soft LLC and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* 1C-Soft LLC - initial API and implementation
*******************************************************************************/
package com.e1c.v8codestyle.internal.right;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.core.platform.IConfigurationProvider;
import com._1c.g5.v8.dt.metadata.mdclass.Configuration;
import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport;
import com._1c.g5.v8.dt.platform.version.Version;
import com._1c.g5.v8.dt.rights.model.Right;
import com._1c.g5.v8.dt.rights.ui.editors.controllers.IRightInfosService;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
/**
* This service is a correct wrapper of {@link IRightInfosService} to get correct data corresponding
* project runtime version.
* <br>
* FIXME Replace this service after refactoring of {@link IRightInfosService}.
*
* @author Dmitriy Marmyshev
*/
@Singleton
public class InternalRightInfosService
{
private final IRuntimeVersionSupport runtimeVersionSupport;
private final IConfigurationProvider configurationProvider;
private final Provider<IRightInfosService> rightInfosServiceProvider;
private final Map<Version, IRightInfosService> infos = new ConcurrentHashMap<>();
@Inject
public InternalRightInfosService(IRuntimeVersionSupport runtimeVersionSupport,
IConfigurationProvider configurationProvider, Provider<IRightInfosService> rightInfosServiceProvider)
{
this.runtimeVersionSupport = runtimeVersionSupport;
this.configurationProvider = configurationProvider;
this.rightInfosServiceProvider = rightInfosServiceProvider;
}
/**
* Gets the rights of some {@link EClass} of configuration metadata object that may has some rights.
*
* @param eClass the {@link EClass} of configuration metadata object that has some rights, cannot be {@code null}.
* @param context the context object of the configuration to determine platform version, cannot be {@code null}.
* @return the rights of the {@link EClass}
*/
public Set<Right> getEClassRights(EClass eClass, EObject context)
{
Version version = runtimeVersionSupport.getRuntimeVersionOrDefault(context, Version.LATEST);
IRightInfosService info = infos.computeIfAbsent(version, v -> {
IRightInfosService service = rightInfosServiceProvider.get();
Configuration configuration = configurationProvider.getConfiguration(context);
service.init(configuration);
return service;
});
if (info == null)
{
return Collections.emptySet();
}
return info.getEClassRights(eClass);
}
}

View File

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (C) 2022, 1C-Soft LLC and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* 1C-Soft LLC - initial API and implementation
*******************************************************************************/
package com.e1c.v8codestyle.internal.right;
import com._1c.g5.v8.dt.rights.ui.editors.controllers.IRightInfosService;
import com.google.inject.AbstractModule;
/**
* The internal service module.
*
* @author Dmitriy Marmyshev
*/
public class ServiceModule
extends AbstractModule
{
private static final String SERVICE_CLASS = "com._1c.g5.v8.dt.internal.rights.ui.editors.RightsInfoService"; //$NON-NLS-1$
@SuppressWarnings("unchecked")
@Override
protected void configure()
{
// XXX remove this when the IRightInfosService become OSGi service
Class<? extends IRightInfosService> clazz = null;
try
{
clazz = (Class<? extends IRightInfosService>)Class.forName(SERVICE_CLASS, true,
IRightInfosService.class.getClassLoader());
}
catch (ClassNotFoundException e)
{
CorePlugin.logError(e);
}
// Here create new instance every time - this allows to bind it to specific platform Version
// See com.e1c.v8codestyle.internal.right.InternalRightInfosService for details.
bind(IRightInfosService.class).to(clazz);
}
}

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightActiveUsers
* {@inheritDoc}
*/
@Inject
public RightActiveUsers(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightActiveUsers(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightActiveUsers
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightActiveUsers_title)
.description(Messages.RightActiveUsers_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightAdministration
* {@inheritDoc}
*/
@Inject
public RightAdministration(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightAdministration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightAdministration
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightAdministration_title)
.description(Messages.RightAdministration_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightAllFunctionsMode
* {@inheritDoc}
*/
@Inject
public RightAllFunctionsMode(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightAllFunctionsMode(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightAllFunctionsMode
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightAllFunctionsMode_title)
.description(Messages.RightAllFunctionsMode_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,10 +44,12 @@ public class RightConfigurationExtensionsAdministration
* {@inheritDoc}
*/
@Inject
public RightConfigurationExtensionsAdministration(IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager)
public RightConfigurationExtensionsAdministration(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -56,7 +62,7 @@ public class RightConfigurationExtensionsAdministration
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightConfigurationExtensionsAdministration_title)
.description(Messages.RightConfigurationExtensionsAdministration_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightDataAdministration
* {@inheritDoc}
*/
@Inject
public RightDataAdministration(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightDataAdministration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightDataAdministration
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightDataAdministration_title)
.description(Messages.RightDataAdministration_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -42,9 +46,12 @@ public class RightExclusiveMode
* @param bmModelManager the BM model manager, cannot be {@code null}.
*/
@Inject
public RightExclusiveMode(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightExclusiveMode(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -57,7 +64,7 @@ public class RightExclusiveMode
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightExclusiveMode_title)
.description(Messages.RightExclusiveMode_description);

View File

@ -13,9 +13,13 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
@ -36,10 +40,12 @@ public class RightInteractiveClearDeletionMarkPredefinedData
* {@inheritDoc}
*/
@Inject
public RightInteractiveClearDeletionMarkPredefinedData(IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager)
public RightInteractiveClearDeletionMarkPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override

View File

@ -13,9 +13,13 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
@ -26,7 +30,7 @@ import com.google.inject.Inject;
* @author Dmitriy Marmyshev
*
*/
public class RightInteracitveDelete
public class RightInteractiveDelete
extends RoleRightSetCheck
{
@ -36,9 +40,12 @@ public class RightInteracitveDelete
* {@inheritDoc}
*/
@Inject
public RightInteracitveDelete(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightInteractiveDelete(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override

View File

@ -13,9 +13,13 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
@ -26,7 +30,7 @@ import com.google.inject.Inject;
* @author Dmitriy Marmyshev
*
*/
public class RightInteracitveDeleteMarkedPredefinedData
public class RightInteractiveDeleteMarkedPredefinedData
extends RoleRightSetCheck
{
@ -36,10 +40,12 @@ public class RightInteracitveDeleteMarkedPredefinedData
* {@inheritDoc}
*/
@Inject
public RightInteracitveDeleteMarkedPredefinedData(IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager)
public RightInteractiveDeleteMarkedPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override

View File

@ -13,9 +13,13 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
@ -26,7 +30,7 @@ import com.google.inject.Inject;
* @author Dmitriy Marmyshev
*
*/
public class RightInteracitveDeletePredefinedData
public class RightInteractiveDeletePredefinedData
extends RoleRightSetCheck
{
@ -36,9 +40,12 @@ public class RightInteracitveDeletePredefinedData
* {@inheritDoc}
*/
@Inject
public RightInteracitveDeletePredefinedData(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightInteractiveDeletePredefinedData(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,10 +44,12 @@ public class RightInteractiveOpenExternalDataProcessors
* {@inheritDoc}
*/
@Inject
public RightInteractiveOpenExternalDataProcessors(IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager)
public RightInteractiveOpenExternalDataProcessors(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -56,7 +62,7 @@ public class RightInteractiveOpenExternalDataProcessors
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightInteractiveOpenExternalDataProcessors_title)
.description(Messages.RightInteractiveOpenExternalDataProcessors_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightInteractiveOpenExternalReports
* {@inheritDoc}
*/
@Inject
public RightInteractiveOpenExternalReports(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightInteractiveOpenExternalReports(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightInteractiveOpenExternalReports
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightInteractiveOpenExternalReports_title)
.description(Messages.RightInteractiveOpenExternalReports_description);

View File

@ -13,9 +13,13 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
@ -36,10 +40,12 @@ public class RightInteractiveSetDeletionMarkPredefinedData
* {@inheritDoc}
*/
@Inject
public RightInteractiveSetDeletionMarkPredefinedData(IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager)
public RightInteractiveSetDeletionMarkPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightOutputToPrinterFileClipboard
* {@inheritDoc}
*/
@Inject
public RightOutputToPrinterFileClipboard(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightOutputToPrinterFileClipboard(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightOutputToPrinterFileClipboard
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightOutputToPrinterFileClipboard_title)
.description(Messages.RightOutputToPrinterFileClipboard_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightSaveUserData
* {@inheritDoc}
*/
@Inject
public RightSaveUserData(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightSaveUserData(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightSaveUserData
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightSaveUserData_title)
.description(Messages.RightSaveUserData_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightStartAutomation
* {@inheritDoc}
*/
@Inject
public RightStartAutomation(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightStartAutomation(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightStartAutomation
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightStartAutomation_title)
.description(Messages.RightStartAutomation_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightStartExternalConnection
* {@inheritDoc}
*/
@Inject
public RightStartExternalConnection(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightStartExternalConnection(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightStartExternalConnection
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightStartExternalConnection_title)
.description(Messages.RightStartExternalConnection_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightStartThickClient
* {@inheritDoc}
*/
@Inject
public RightStartThickClient(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightStartThickClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightStartThickClient
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightStartThickClient_title)
.description(Messages.RightStartThickClient_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightStartThinClient
* {@inheritDoc}
*/
@Inject
public RightStartThinClient(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightStartThinClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightStartThinClient
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightStartThinClient_title)
.description(Messages.RightStartThinClient_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightStartWebClient
* {@inheritDoc}
*/
@Inject
public RightStartWebClient(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightStartWebClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightStartWebClient
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightStartWebClient_title)
.description(Messages.RightStartWebClient_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -40,9 +44,12 @@ public class RightUpdateDatabaseConfiguration
* {@inheritDoc}
*/
@Inject
public RightUpdateDatabaseConfiguration(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightUpdateDatabaseConfiguration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -55,7 +62,7 @@ public class RightUpdateDatabaseConfiguration
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightUpdateDatabaseConfiguration_title)
.description(Messages.RightUpdateDatabaseConfiguration_description);

View File

@ -14,11 +14,15 @@ package com.e1c.v8codestyle.right.check;
import java.util.List;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@ -43,9 +47,13 @@ public class RightViewEventLog
* @param bmModelManager the BM model manager, cannot be {@code null}.
*/
@Inject
public RightViewEventLog(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
public RightViewEventLog(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService,
IBmModelManager bmModelManager2)
{
super(v8ProjectManager, bmModelManager);
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
}
@Override
@ -58,7 +66,7 @@ public class RightViewEventLog
protected void configureCheck(CheckConfigurer builder)
{
super.configureCheck(builder);
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, bmModelManager))
builder.extension(new ExcludeRoleByNameListExtension(NAMES_DEFAULT, getBmModelManager()))
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.title(Messages.RightViewEventLog_title)
.description(Messages.RightViewEventLog_description);

View File

@ -13,21 +13,50 @@
*******************************************************************************/
package com.e1c.v8codestyle.right.check;
import static com._1c.g5.v8.dt.metadata.mdclass.MdClassPackage.Literals.MD_OBJECT;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.OBJECT_RIGHT;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.OBJECT_RIGHTS;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.OBJECT_RIGHTS__OBJECT;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.OBJECT_RIGHT__RIGHT;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.OBJECT_RIGHT__VALUE;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.ROLE_DESCRIPTION;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.ROLE_DESCRIPTION__RIGHTS;
import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.ROLE_DESCRIPTION__SET_FOR_NEW_OBJECTS;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.resource.IEObjectDescription;
import com._1c.g5.v8.bm.core.BmUriUtil;
import com._1c.g5.v8.bm.core.IBmObject;
import com._1c.g5.v8.bm.core.IBmTransaction;
import com._1c.g5.v8.bm.integration.IBmModel;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexManager;
import com._1c.g5.v8.dt.bm.index.emf.IBmEmfIndexProvider;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexProvider;
import com._1c.g5.v8.dt.bm.index.rights.IRightsDescription;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.NamedElement;
import com._1c.g5.v8.dt.md.MdUtil;
import com._1c.g5.v8.dt.metadata.mdclass.MdObject;
import com._1c.g5.v8.dt.metadata.mdclass.Role;
@ -40,16 +69,33 @@ import com._1c.g5.v8.dt.rights.model.RoleDescription;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com._1c.g5.v8.dt.rights.model.util.RightsModelUtil;
import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckDefinition;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.components.BasicCheck;
import com.e1c.g5.v8.dt.check.components.IBasicCheckExtension;
import com.e1c.g5.v8.dt.check.context.CheckContextCollectingSession;
import com.e1c.g5.v8.dt.check.context.OnModelObjectAssociationContextCollector;
import com.e1c.g5.v8.dt.check.context.OnModelObjectRemovalContextCollector;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
import com.google.inject.Inject;
import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
/**
* Abstract check that role has some right for any object.
* This check register for two different types of object.
* <ul><li>
* Registers for {@link RoleDescription} and check it only it has flag {@link RoleDescription#isSetForNewObjects()}
* which means data model contains only non-default rights for an object.
* </li><li>
* Also it registers for {@link ObjectRight} that contain specific right for certain object.
* </li></ul>
* <br>
* The check reacts on changes in intermediate object {@link ObjectRights} to reschedule check for top-object.
* <br>
* Implementors should call {@code super.configureCheck(builder);} when overriding
* method {@link #configureCheck(CheckConfigurer)}
*
* @author Dmitriy Marmyshev
*
@ -60,37 +106,54 @@ public abstract class RoleRightSetCheck
protected static final String EXCLUDE_OBJECT_NAME_PATTERN_PARAMETER_NAME = "excludeObjectNamePattern"; //$NON-NLS-1$
private final IResourceLookup resourceLookup;
private final IV8ProjectManager v8ProjectManager;
protected final IBmModelManager bmModelManager;
private final IBmModelManager bmModelManager;
private final IBmRightsIndexManager bmRightsIndexManager;
private final IBmEmfIndexManager bmEmfIndexManager;
private final InternalRightInfosService rightInfosService;
/**
* Creates new instance which helps to check that role has specified right for an object.
*
* @param v8ProjectManager the V8 project manager, cannot be {@code null}.
* @param bmModelManager the BM model manager, cannot be {@code null}.
* @param bmRightsIndexProvider the BM rights index provider, cannot be {@code null}.
* @param bmEmfIndexProvider the BM EMF index provider, cannot be {@code null}.
* @param rightInfosService the right info service, cannot be {@code null}.
*/
@Inject
protected RoleRightSetCheck(IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager)
protected RoleRightSetCheck(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
{
this.resourceLookup = resourceLookup;
this.v8ProjectManager = v8ProjectManager;
this.bmModelManager = bmModelManager;
this.bmRightsIndexManager = bmRightsIndexManager;
this.bmEmfIndexManager = bmEmfIndexManager;
this.rightInfosService = rightInfosService;
}
@Override
protected void configureCheck(CheckConfigurer builder)
{
//@formatter:off
builder.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MAJOR)
.issueType(IssueType.SECURITY)
.extension(new CombinedChangeExtension())
.extension(new ExcludeRoleByPatternExtension(bmModelManager))
.extension(new RoleNameChangeExtension())
.extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID))
.topObject(ROLE_DESCRIPTION)
.checkTop()
.features(ROLE_DESCRIPTION__SET_FOR_NEW_OBJECTS, ROLE_DESCRIPTION__RIGHTS)
.containment(OBJECT_RIGHT)
.features(OBJECT_RIGHT__RIGHT, OBJECT_RIGHT__VALUE);
//@formatter:on
if (needCheckObjectRight())
{
@ -103,47 +166,24 @@ public abstract class RoleRightSetCheck
protected void check(Object object, ResultAcceptor resultAceptor, ICheckParameters parameters,
IProgressMonitor monitor)
{
ObjectRight objectRight = (ObjectRight)object;
Right right = objectRight.getRight();
if (right == null || !getRightName().getName().equals(right.getName()))
if (object instanceof RoleDescription)
{
return;
check((RoleDescription)object, resultAceptor, parameters, monitor);
}
Role role = null;
RightValue rightValue = objectRight.getValue();
if (rightValue == null)
else if (object instanceof ObjectRight)
{
role = getRole(objectRight);
rightValue = RightsModelUtil.getDefaultRightValue(objectRight, role);
check((ObjectRight)object, resultAceptor, parameters, monitor);
}
}
if (!RightsModelUtil.getBooleanRightValue(rightValue) || monitor.isCanceled())
{
return;
}
ObjectRights rights = EcoreUtil2.getContainerOfType(objectRight, ObjectRights.class);
MdObject mdObject = rights.getObject() instanceof MdObject ? (MdObject)rights.getObject() : null;
if (mdObject == null)
{
return;
}
if (needCheckObjectRight())
{
String excludeObjectNamePattern = parameters.getString(EXCLUDE_OBJECT_NAME_PATTERN_PARAMETER_NAME);
if (excludeObjectNamePattern != null && !excludeObjectNamePattern.isBlank()
&& mdObject.getName().matches(excludeObjectNamePattern))
{
return;
}
}
String message = getIssueMessage(right, mdObject);
resultAceptor.addIssue(message, OBJECT_RIGHT__RIGHT);
/**
* Gets the BM model manager service.
*
* @return the BM model manager, cannot return {@code null}.
*/
protected IBmModelManager getBmModelManager()
{
return bmModelManager;
}
/**
@ -156,14 +196,13 @@ public abstract class RoleRightSetCheck
/**
* Creates formated issue message for the right and the MD object.
*
* @param right the right that forbidden to set for the MD object, cannot be {@code null}.
* @param mdObject the MD object that has forbidden right, cannot be {@code null}.
* @return the formatted issue message that right set for the object, cannot return {@code null}.
*/
protected String getIssueMessage(Right right, MdObject mdObject)
protected String getIssueMessage(MdObject mdObject)
{
IV8Project project = mdObject == null ? null : v8ProjectManager.getProject(mdObject);
String rightName = getRightName(right, project);
String rightName = getRightName(project);
String mdObjectName = getMdObjectName(mdObject, project);
return MessageFormat.format(Messages.RoleRightSetCheck_Role_right__0__set_for__1, rightName, mdObjectName);
}
@ -178,6 +217,91 @@ public abstract class RoleRightSetCheck
return true;
}
private void check(RoleDescription object, ResultAcceptor resultAceptor, ICheckParameters parameters,
IProgressMonitor monitor)
{
if (!object.isSetForNewObjects())
{
return;
}
Collection<MdObject> mdObjects = getDefaultObjectsWithRight(object, monitor);
List<ObjectRights> rights = object.getRights();
for (MdObject mdObject : mdObjects)
{
if (monitor.isCanceled())
{
return;
}
if (needCheckObjectRight())
{
String excludeObjectNamePattern = parameters.getString(EXCLUDE_OBJECT_NAME_PATTERN_PARAMETER_NAME);
if (excludeObjectNamePattern != null && !excludeObjectNamePattern.isBlank()
&& mdObject.getName().matches(excludeObjectNamePattern))
{
continue;
}
}
String message = getIssueMessage(mdObject);
ObjectRights objectRights = RightsModelUtil.filterObjectRightsByEObject(mdObject, rights);
if (objectRights == null)
{
resultAceptor.addIssue(message, ROLE_DESCRIPTION__RIGHTS);
}
else
{
// add marker as closer as possible to the probleb place in the model
resultAceptor.addIssue(message, objectRights, OBJECT_RIGHTS__OBJECT);
}
}
}
private void check(ObjectRight object, ResultAcceptor resultAceptor, ICheckParameters parameters,
IProgressMonitor monitor)
{
Right right = object.getRight();
if (right == null || !getRightName().getName().equals(right.getName()))
{
return;
}
Role role = null;
RightValue rightValue = object.getValue();
if (rightValue == null)
{
role = getRole(object);
rightValue = RightsModelUtil.getDefaultRightValue(object, role);
}
if (!RightsModelUtil.getBooleanRightValue(rightValue) || monitor.isCanceled())
{
return;
}
ObjectRights rights = EcoreUtil2.getContainerOfType(object, ObjectRights.class);
MdObject mdObject = rights.getObject() instanceof MdObject ? (MdObject)rights.getObject() : null;
if (mdObject == null || monitor.isCanceled())
{
return;
}
if (needCheckObjectRight())
{
String excludeObjectNamePattern = parameters.getString(EXCLUDE_OBJECT_NAME_PATTERN_PARAMETER_NAME);
if (excludeObjectNamePattern != null && !excludeObjectNamePattern.isBlank()
&& mdObject.getName().matches(excludeObjectNamePattern))
{
return;
}
}
String message = getIssueMessage(mdObject);
resultAceptor.addIssue(message, OBJECT_RIGHT__RIGHT);
}
private Role getRole(ObjectRight objectRight)
{
IBmModel model = bmModelManager.getModel(objectRight);
@ -185,8 +309,9 @@ public abstract class RoleRightSetCheck
return RightsModelUtil.getOwner(description, model);
}
private String getRightName(Right right, IV8Project project)
private String getRightName(IV8Project project)
{
RightName right = getRightName();
if (project != null && project.getScriptVariant() == ScriptVariant.RUSSIAN)
{
return right.getNameRu();
@ -210,4 +335,185 @@ public abstract class RoleRightSetCheck
return MdUtil.getFullyQualifiedName(mdObject).toString();
}
private Collection<MdObject> getDefaultObjectsWithRight(RoleDescription description, IProgressMonitor monitor)
{
Collection<MdObject> result = new LinkedList<>();
IProject project = resourceLookup.getProject(description);
Set<Long> objectIdForRole = getRoleTopObjects(project, description, monitor);
if (monitor.isCanceled())
{
return Collections.emptyList();
}
IBmEmfIndexProvider bmEmfIndexProvider = bmEmfIndexManager.getEmfIndexProvider(project);
RightsModelUtil.SUPPORTED_RIGHT_ECLASSES.stream().forEach(eClass -> {
// filter class that can't have needed right
if (!hasRight(eClass, description))
{
return;
}
for (Iterator<IEObjectDescription> iterator =
bmEmfIndexProvider.getEObjectIndexByType(eClass).iterator(); iterator.hasNext();)
{
if (monitor.isCanceled())
{
return;
}
IEObjectDescription objectDescription = iterator.next();
EObject object = objectDescription.getEObjectOrProxy();
if (object instanceof IBmObject && object instanceof MdObject)
{
final long bmObjectId = ((IBmObject)object).bmGetId();
if (!objectIdForRole.contains(bmObjectId))
{
result.add((MdObject)object);
}
}
}
});
return result;
}
private Set<Long> getRoleTopObjects(IProject project, RoleDescription description, IProgressMonitor monitor)
{
IBmModel model = bmModelManager.getModel(description);
Role role = RightsModelUtil.getOwner(description, model);
IBmRightsIndexProvider bmRightsIndexProvider = bmRightsIndexManager.getRightsIndexProvider(project);
IRightsDescription roleIndex = bmRightsIndexProvider.getRoleIndex(role);
if (roleIndex == null)
{
return Collections.emptySet();
}
Set<Long> result = new HashSet<>();
Set<Long> topObjects = roleIndex.getTopObjectsWithNonDefaultRights();
String rightName = getRightName().getName();
for (Long objectId : topObjects)
{
if (monitor.isCanceled())
{
return Collections.emptySet();
}
Map<String, Boolean> rights = roleIndex.getRights(objectId);
if (rights != null && rights.containsKey(rightName))
{
result.add(objectId);
}
}
return result;
}
private boolean hasRight(EClass eClass, EObject context)
{
Set<Right> rights = rightInfosService.getEClassRights(eClass, context);
Set<String> rightNames = rights.stream().map(NamedElement::getName).collect(Collectors.toSet());
return rightNames.contains(getRightName().getName());
}
/**
* This extension is combining all changes in containments of RoleDescription and schedule TOP object if needed.
* Also it reacts on adding or removing TOP MD-objects and schedule all role descriptions with SetForNewObjects.
*/
private final class CombinedChangeExtension
implements IBasicCheckExtension
{
@Override
public void configureContextCollector(ICheckDefinition definition)
{
// add reaction change of features "SET_FOR_NEW_OBJECTS" of existing object
definition.addModelFeatureChangeContextCollector((bmObject, feature, bmEvent, contextSession) -> {
if (feature == ROLE_DESCRIPTION__SET_FOR_NEW_OBJECTS)
{
// global flag changed - so fully re-check ROLE_DESCRIPTION for all checks
contextSession.addFullCheck(bmObject);
}
}, ROLE_DESCRIPTION);
// if MD object changed then schedule full check for description or even for all checks
definition.addModelFeatureChangeContextCollector((bmObject, feature, bmEvent, contextSession) -> {
if (feature == OBJECT_RIGHTS__OBJECT)
{
IBmObject top = bmObject.bmGetTopObject();
if (top instanceof RoleDescription && ((RoleDescription)top).isSetForNewObjects())
{
contextSession.addModelCheck(top);
}
else if (top instanceof RoleDescription)
{
// schedule full check for top for all checks
contextSession.addFullCheck(top);
}
}
}, OBJECT_RIGHTS);
// add reaction on creating new objects - that schedule role description
OnModelObjectAssociationContextCollector topCollector = (bmObject, bmEvent, contextSession) -> {
IBmObject top = bmObject.bmGetTopObject();
if (top instanceof RoleDescription && ((RoleDescription)top).isSetForNewObjects())
{
contextSession.addModelCheck(top);
}
};
definition.addModelAssociationContextCollector(topCollector, OBJECT_RIGHTS);
definition.addModelAssociationContextCollector(topCollector, OBJECT_RIGHT);
// For every new TOP MD object schedule all role descriptions with SetForNewObjects
definition.addModelAssociationContextCollector((bmObject, bmEvent, contextSession) -> {
if (bmObject.bmIsTop() && bmObject.bmGetTransaction() != null)
{
scheduleFullCheckForAllRoles(bmObject.eClass(), bmObject.bmGetTransaction(), contextSession);
}
}, MD_OBJECT);
// if delete some objects then re-schedule full check for role description
OnModelObjectRemovalContextCollector containmentRemoval =
(removedObjectUri, removedObjectEClass, bmEvent, contextSession, transaction) -> {
URI topUri = removedObjectUri.trimFragment().appendFragment(BmUriUtil.TOP_OBJECT_PATH);
IBmObject top = transaction.getObjectByUri(topUri);
if (top instanceof RoleDescription && ((RoleDescription)top).isSetForNewObjects())
{
contextSession.addModelCheck(top);
}
};
definition.addModelRemovalContextCollector(containmentRemoval, OBJECT_RIGHTS);
definition.addModelRemovalContextCollector(containmentRemoval, OBJECT_RIGHT);
// if TOP object removed then schedule all role descriptions with SetForNewObjects
definition.addModelRemovalContextCollector(
(removedObjectUri, removedObjectEClass, bmEvent, contextSession, transaction) -> {
if (BmUriUtil.TOP_OBJECT_PATH.equals(removedObjectUri.fragment()))
{
scheduleFullCheckForAllRoles(removedObjectEClass, transaction, contextSession);
}
}, MD_OBJECT);
}
private void scheduleFullCheckForAllRoles(EClass eClass, IBmTransaction transaction,
CheckContextCollectingSession contextSession)
{
if (transaction != null && RightsModelUtil.SUPPORTED_RIGHT_ECLASSES.contains(eClass))
{
for (Iterator<IBmObject> iterator = transaction.getTopObjectIterator(ROLE_DESCRIPTION); iterator
.hasNext();)
{
IBmObject object = iterator.next();
if (object instanceof RoleDescription && ((RoleDescription)object).isSetForNewObjects())
{
contextSession.addFullCheck(object);
}
}
}
}
}
}

View File

@ -30,17 +30,17 @@ import com._1c.g5.v8.dt.rights.model.util.RightName;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com.e1c.g5.v8.dt.check.settings.CheckUid;
import com.e1c.g5.v8.dt.testing.check.CheckTestBase;
import com.e1c.v8codestyle.right.check.RightInteracitveDelete;
import com.e1c.v8codestyle.right.check.RightInteracitveDeleteMarkedPredefinedData;
import com.e1c.v8codestyle.right.check.RightInteracitveDeletePredefinedData;
import com.e1c.v8codestyle.right.check.RightInteractiveClearDeletionMarkPredefinedData;
import com.e1c.v8codestyle.right.check.RightInteractiveDelete;
import com.e1c.v8codestyle.right.check.RightInteractiveDeleteMarkedPredefinedData;
import com.e1c.v8codestyle.right.check.RightInteractiveDeletePredefinedData;
import com.e1c.v8codestyle.right.check.RightInteractiveSetDeletionMarkPredefinedData;
/**
* Tests for all forbidden rights checks:
* {@link RightInteracitveDelete},
* {@link RightInteracitveDeleteMarkedPredefinedData},
* {@link RightInteracitveDeletePredefinedData},
* {@link RightInteractiveDelete},
* {@link RightInteractiveDeleteMarkedPredefinedData},
* {@link RightInteractiveDeletePredefinedData},
* {@link RightInteractiveClearDeletionMarkPredefinedData},
* {@link RightInteractiveSetDeletionMarkPredefinedData}.
*
@ -64,6 +64,8 @@ public class RoleRightHasForbiddenTest
private static final String FQN_FORBIDDEN_RIGHTS = "Role.ForbiddenRights.Rights";
private static final String FQN_FORBIDDEN_RIGHTS2 = "Role.FullAccess.Rights";
private static final String FQN_ALLOWED_RIGHTS = "Role.AllowedRights.Rights";
private IDtProject dtProject;
@ -93,12 +95,12 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has forbidden right, check {@link RightInteracitveDelete}
* Test role has forbidden right, check {@link RightInteractiveDelete}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasRightInteracitveDelete() throws Exception
public void testRoleHasRightInteractiveDelete() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_FORBIDDEN_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);
@ -114,12 +116,28 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has forbidden right, check {@link RightInteracitveDeleteMarkedPredefinedData}
* Test role has forbidden right in FullAccess role, check {@link RightInteractiveDelete}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasRightInteracitveDeleteMarkedPredefinedData() throws Exception
public void testRoleHasRightInteractiveDelete2() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_FORBIDDEN_RIGHTS2, dtProject);
assertTrue(top instanceof RoleDescription);
Marker marker = getFirstMarker(CHECK_ID_1, top, dtProject);
assertNotNull(marker);
}
/**
* Test role has forbidden right, check {@link RightInteractiveDeleteMarkedPredefinedData}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasRightInteractiveDeleteMarkedPredefinedData() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_FORBIDDEN_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);
@ -135,12 +153,12 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has forbidden right, check {@link RightInteracitveDeletePredefinedData}
* Test role has forbidden right, check {@link RightInteractiveDeletePredefinedData}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasRightInteracitveDeletePredefinedData() throws Exception
public void testRoleHasRightInteractiveDeletePredefinedData() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_FORBIDDEN_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);
@ -198,12 +216,12 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has no forbidden right, check {@link RightInteracitveDelete}
* Test role has no forbidden right, check {@link RightInteractiveDelete}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasNoRightInteracitveDelete() throws Exception
public void testRoleHasNoRightInteractiveDelete() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_ALLOWED_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);
@ -220,12 +238,12 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has no forbidden right, check {@link RightInteracitveDeleteMarkedPredefinedData}
* Test role has no forbidden right, check {@link RightInteractiveDeleteMarkedPredefinedData}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasNoRightInteracitveDeleteMarkedPredefinedData() throws Exception
public void testRoleHasNoRightInteractiveDeleteMarkedPredefinedData() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_ALLOWED_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);
@ -242,12 +260,12 @@ public class RoleRightHasForbiddenTest
}
/**
* Test role has no forbidden right, check {@link RightInteracitveDeletePredefinedData}
* Test role has no forbidden right, check {@link RightInteractiveDeletePredefinedData}
*
* @throws Exception the exception
*/
@Test
public void testRoleHasNoRightInteracitveDeletePredefinedData() throws Exception
public void testRoleHasNoRightInteractiveDeletePredefinedData() throws Exception
{
IBmObject top = getTopObjectByFqn(FQN_ALLOWED_RIGHTS, dtProject);
assertTrue(top instanceof RoleDescription);