You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.8 KiB
119 lines
3.8 KiB
// ==================================================
|
|
// Copyright 2020 Siemens Digital Industries Software
|
|
// ==================================================
|
|
// Copyright 2013.
|
|
// Siemens Product Lifecycle Management Software Inc.
|
|
// All Rights Reserved.
|
|
// ==================================================
|
|
// Copyright 2020 Siemens Digital Industries Software
|
|
/*===============================================================================
|
|
Date Name Description of Change
|
|
04-Nov-2013 Johann Chemin-Danielson Creation
|
|
$HISTORY$
|
|
=============================================================================*/
|
|
|
|
/**
|
|
@file LoggedInUser.hxx
|
|
|
|
Service class for access to information on the logged-in user.
|
|
*/
|
|
|
|
#ifndef TEAMCENTER_CORE_LOGGED_IN_USER_HXX
|
|
#define TEAMCENTER_CORE_LOGGED_IN_USER_HXX
|
|
|
|
#include <unidefs.h>
|
|
|
|
#include <tc/libtc_exports.h>
|
|
|
|
namespace Teamcenter
|
|
{
|
|
namespace Core
|
|
{
|
|
/**
|
|
@brief Access to information on the logged-in user.
|
|
*/
|
|
class TC_API LoggedInUser
|
|
{
|
|
public:
|
|
/**
|
|
Accessor to the unique instance
|
|
*/
|
|
static LoggedInUser* getInstance();
|
|
|
|
/**
|
|
Retrieves the ID of the logged-in user.
|
|
*/
|
|
virtual const char* getCurrentUserID() = 0;
|
|
|
|
/**
|
|
Determines if the logged-in user is an administrator of some sort (either system or group).
|
|
*/
|
|
virtual logical isUserPrivileged () = 0;
|
|
|
|
/**
|
|
Determines if the logged-in user is a system administrator.
|
|
*/
|
|
virtual logical isUserSystemAdministrator() = 0;
|
|
|
|
/**
|
|
Determines if the logged-in user is an administrator of the specified group.
|
|
|
|
@param[in] groupName The name of the group to check
|
|
*/
|
|
virtual logical isUserGroupAdministrator( const char* groupName ) = 0;
|
|
|
|
/**
|
|
Determines if the logged-in user is an administrator of the specified group.
|
|
|
|
@param[in] groupTag The tag of the group to check
|
|
*/
|
|
virtual logical isUserGroupAdministrator( tag_t groupTag ) = 0;
|
|
|
|
/**
|
|
Retrieves the tag of the current logged-in user.
|
|
*/
|
|
virtual tag_t getCurrentUserTag () = 0;
|
|
|
|
/**
|
|
Retrieves the group tag of the logged-in user.
|
|
*/
|
|
virtual tag_t getCurrentGroupTag () = 0;
|
|
|
|
/**
|
|
Determines if the current group of the logged-in user is the one specified by the parameter #groupName.
|
|
|
|
@param[in] groupName The name of the group to check
|
|
*/
|
|
virtual logical isGroupCurrentGroup( const char* groupName ) = 0;
|
|
|
|
/**
|
|
Retrieves the role tag of the logged-in user.
|
|
*/
|
|
virtual tag_t getCurrentRoleTag () = 0;
|
|
|
|
/**
|
|
Determines if the current role of the logged-in user is the one specified by the parameter #roleName.
|
|
|
|
@param[in] roleName The name of the role to check
|
|
*/
|
|
virtual logical isRoleCurrentRole( const char* roleName ) = 0;
|
|
|
|
/**
|
|
Determines if the current logged-in user is a member of the specified role in the specified group.
|
|
|
|
@param[in] groupName The name of the group to check
|
|
@param[in] roleName The name of the role to check
|
|
*/
|
|
virtual logical isAMemberOfGroupAndRole( const char* groupName, const char* roleName ) = 0;
|
|
|
|
protected:
|
|
LoggedInUser();
|
|
LoggedInUser(const LoggedInUser&);
|
|
LoggedInUser& operator = ( const LoggedInUser& );
|
|
virtual ~LoggedInUser();
|
|
};
|
|
}
|
|
}
|
|
#include <tc/libtc_undef.h>
|
|
#endif
|