提交 7b3e1a46 编写于 作者: R roo00

bug fix

上级 bb35f294
......@@ -18,4 +18,8 @@ public class ExceptionEntityNotExist extends PromptException {
super("标识为:{} 的 {} 对象不存在.", flag, name);
}
public <T extends JpaObject> ExceptionEntityNotExist(String flag) {
super("标识为:{} 的对象不存在.", flag);
}
}
......@@ -129,8 +129,8 @@ public class EffectivePerson extends GsonPropertyObject {
return !this.isManager();
}
public boolean isUser(Collection<String> names) {
if (Objects.equals(TokenType.user, this.getTokenType())) {
public boolean isPerson(Collection<String> names) {
if (Objects.equals(TokenType.user, this.getTokenType())||Objects.equals(TokenType.manager, this.getTokenType())) {
if (null != names) {
List<String> list = new ArrayList<>(names);
if (list.contains(this.distinguishedName)) {
......@@ -154,16 +154,16 @@ public class EffectivePerson extends GsonPropertyObject {
return false;
}
public boolean isUser(String... names) {
return this.isUser(Arrays.asList(names));
public boolean isPerson(String... names) {
return this.isPerson(Arrays.asList(names));
}
public boolean isNotUser(String... names) {
return !this.isUser(names);
public boolean isNotPerson(String... names) {
return !this.isPerson(names);
}
public boolean isNotUser(Collection<String> names) {
return !this.isUser(names);
public boolean isNotPerson(Collection<String> names) {
return !this.isPerson(names);
}
public String getToken() {
......
......@@ -5,11 +5,11 @@ import org.apache.commons.beanutils.PropertyUtils;
public class PropertyTools {
@SuppressWarnings("unchecked")
public static <T> T getOrElse(Object bean, String name, Class<T> cls, T defaultObject) throws Exception {
if (null == bean) {
return defaultObject;
}
if (PropertyUtils.isReadable(bean, name)) {
return (T) PropertyUtils.getProperty(bean, name);
if ((null != bean) && PropertyUtils.isReadable(bean, name)) {
Object o = PropertyUtils.getProperty(bean, name);
if (null != o) {
return (T) o;
}
}
return defaultObject;
}
......
......@@ -35,13 +35,13 @@ public class QueryViewFactory extends ElementFactory {
&& ListTools.isEmpty(queryView.getAvailablePersonList())) {
return true;
}
if (effectivePerson.isUser(queryView.getCreatorPerson())) {
if (effectivePerson.isPerson(queryView.getCreatorPerson())) {
return true;
}
if (effectivePerson.isManager()) {
return true;
}
if (effectivePerson.isUser(queryView.getControllerList())) {
if (effectivePerson.isPerson(queryView.getControllerList())) {
return true;
}
if (ListTools.isNotEmpty(queryView.getAvailablePersonList())) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册