Как можно сделать так, чтобы определенная экранная форма открывалась одному определенному юзеру(через привилегии)
Могу предложить такой вариант через специфичные права, как завести их в документации описано (https://doc.cuba-platform.com/manual-6.4/permissions.html).
import com.haulmont.cuba.core.global.Security;
import com.haulmont.cuba.gui.WindowManager;
import javax.inject.Inject;
…
@Inject
private Security security;
…
public void …
if (!security.isSpecificPermitted(“app.MyPermission”)) {
openWindow(“my first window”,WindowManager.OpenType.DIALOG)
} else
{
openWindow(“my second window”,WindowManager.OpenType.DIALOG)
}
У меня в базе есть роли как мне проверить роль текущего пользователя и если права совпадают то открывать экранную форму можете пример скинуть
Для стандартных прав есть функция isPermitted
Из документации (https://doc.cuba-platform.com/manual-6.5/constraints.html)
A developer can check the constraints conditions for the particular entity using the following methods of the Security interface:
isPermitted(Entity, ConstraintOperationType) - to check constraints by the operation type.
isPermitted(Entity, String) - to check constraints by the string code.
import com.haulmont.cuba.core.global.Security;
import com.haulmont.cuba.gui.WindowManager;
import javax.inject.Inject;
…
@Inject
private Security security;
…
public void …
if (!security.isPermitted(MyEntity,“MyString”)) {
openWindow(“my first window”,WindowManager.OpenType.DIALOG)
} else
{
openWindow(“my second window”,WindowManager.OpenType.DIALOG)
}
Так же есть права на атрибуты, на доступ к видимости экранов и тд.
Без уточнения задачи дать точный ответ сложно.