查看: 2469|回复: 0

Teamcenter二次开发源码分享;判断当前用户是否为DBA

[复制链接]

2480

主题

1280

回帖

8万

积分

管理员

PLM之家站长

积分
82278
QQ
发表于 2020-2-8 09:35:45 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

×

0 X! ~0 H$ o6 ^1 g9 m- w, A' O
* a) X, l6 m/ J6 f; p0 ZTeamcenter二次开发源码分享;判断当前用户是否为DBA" w& A% Z( a1 `$ T- Y/ x

$ _( \% I5 R3 V! m[mw_shl_code=cpp,true]#include <TC/LoggedInUser.hxx>8 \2 L' ^+ `8 G

5 F+ ^6 z' E" F9 j& o  ousing namespace std;
# y8 K' s, p2 \! R" cusing namespace Teamcenter::Core;
$ ?# X9 D0 l% Q. [# L" V8 f, Y+ Y! S0 ?- P0 F- b/ V
static logical isCurrentUserDba()1 a4 |% w8 v0 s  S" ~
{" c6 M, N: D* s
    LoggedInUser* loggedInUser = LoggedInUser::getInstance();' t- x5 i0 A3 h3 i4 @  ]5 [
, l' \- L) a" Y# W
    logical isDba = loggedInUser->isUserSystemAdministrator();
6 e$ s3 k$ M  V" P+ D& w    if(isDba == TRUE) cout << "    User is dba member "<< endl;
; Q/ Q( g' G  a0 d    if(isDba == FALSE) cout << "    User is not dba member "<< endl;7 H, {- p4 B" ^) o& V1 c
    ( p# z: e2 }# s9 l: D; h% S5 L) e
    return isDba;
1 D8 }+ Z- a0 L5 h' c3 I}[/mw_shl_code]( s6 M  C1 O" W: A2 \! p$ V
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部