$ F, n+ T+ v S4 s$ U8 N+ c! g2 J9 `8 K3 U Teamcenter二次开发源码分享;判断当前用户是否为DBA * C: q4 K. A' U/ t g4 W- Q$ L% x9 ~8 S# P
[mw_shl_code=cpp,true]#include <TC/LoggedInUser.hxx>* P5 T2 e( a1 f0 a' f$ f7 A
, B# f2 G# q9 B( T+ C
using namespace std;# B2 o, b) _) ^6 C R/ T9 _ x
using namespace Teamcenter::Core;4 ]% Y9 _ ^: A. D
( D& u& U+ n- H7 \; @! D A5 Zstatic logical isCurrentUserDba()9 L+ H" p& k) I
{ * z; U, L, l0 H" ]. J9 w LoggedInUser* loggedInUser = LoggedInUser::getInstance(); 7 v k2 U. `9 G! X; m; f7 y/ O2 g' L" k0 `3 E1 \2 X
logical isDba = loggedInUser->isUserSystemAdministrator(); % a; d4 u) L3 c; A' S if(isDba == TRUE) cout << " User is dba member "<< endl; 0 M7 ] D8 h+ i: V9 Q5 \# S if(isDba == FALSE) cout << " User is not dba member "<< endl;7 O6 q* A6 x1 H: R2 ^0 D" C