|
|
@ -9,11 +9,14 @@ import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.remote.ui.AuthorityManagerPane; |
|
|
|
import com.fr.design.remote.ui.AuthorityManagerPane; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.report.DesignAuthority; |
|
|
|
import com.fr.report.DesignAuthority; |
|
|
|
|
|
|
|
import com.fr.report.constant.RoleType; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.server.authority.AuthorityOperator; |
|
|
|
import com.fr.workspace.server.authority.AuthorityOperator; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author yaohwu |
|
|
|
* @author yaohwu |
|
|
@ -38,13 +41,24 @@ public class RemoteDesignAuthManagerAction extends UpdateAction { |
|
|
|
if (!WorkContext.getCurrent().isLocal()) { |
|
|
|
if (!WorkContext.getCurrent().isLocal()) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// 远程设计获取全部设计成员的权限列表
|
|
|
|
// 远程设计获取全部设计成员的权限列表
|
|
|
|
DesignAuthority[] userAuthorities = WorkContext.getCurrent().get(AuthorityOperator.class).getUserAuthorities(); |
|
|
|
DesignAuthority[] authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities(); |
|
|
|
DesignAuthority[] customAuthorities = WorkContext.getCurrent().get(AuthorityOperator.class).getCustomRoleAuthorities(); |
|
|
|
List<DesignAuthority> userAuthorities = new ArrayList<DesignAuthority>(); |
|
|
|
if (userAuthorities != null && userAuthorities.length != 0) { |
|
|
|
List<DesignAuthority> customAuthorities = new ArrayList<DesignAuthority>(); |
|
|
|
managerPane.populateByUser(userAuthorities); |
|
|
|
if (authorities != null) { |
|
|
|
|
|
|
|
for (DesignAuthority authority : authorities) { |
|
|
|
|
|
|
|
if (authority.getRoleType() == RoleType.CUSTOM) { |
|
|
|
|
|
|
|
customAuthorities.add(authority); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
userAuthorities.add(authority); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (userAuthorities.size() != 0) { |
|
|
|
|
|
|
|
managerPane.populateByUser(userAuthorities.toArray(new DesignAuthority[userAuthorities.size()])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (customAuthorities.size() != 0) { |
|
|
|
|
|
|
|
managerPane.populateByCustom(customAuthorities.toArray(new DesignAuthority[customAuthorities.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
if (customAuthorities != null && customAuthorities.length != 0) { |
|
|
|
|
|
|
|
managerPane.populateByCustom(customAuthorities); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception exception) { |
|
|
|
} catch (Exception exception) { |
|
|
|
FineLoggerFactory.getLogger().error(exception.getMessage(), exception); |
|
|
|
FineLoggerFactory.getLogger().error(exception.getMessage(), exception); |
|
|
|