// Copyright 2020 Siemens Digital Industries Software
// ==================================================
// Copyright 2013.
// Siemens Product Lifecycle Management Software Inc.
// All Rights Reserved.
// ==================================================
// Copyright 2020 Siemens Digital Industries Software
 
/** 
    @file 
 
    Sets privileges for system administrators, in order to bypass Access Manager controls on objects.
*/

#ifndef TEAMCENTER_ITKBYPASS_HXX
#define TEAMCENTER_ITKBYPASS_HXX

#include <fclasses/libfclasses_exports.h>

namespace Teamcenter
{
    /** 
        @brief Sets privileges for system administrators, in order to bypass Access Manager controls on objects. 
       
        <br/>Creating an object of this class will set the ITK bypass privilege.
        When this object is destroyed the ITK bypass will be reset.
        <br/>This class uses ITK_set_bypass method which allows a system administrator 
        to bypass Access Manager controls on objects. System administrator may use this
        to modify, delete, or access objects. When using the old Access Manager, all access controls 
        are disabled by the bypass facility.
    */
    class FCLASSES_API ITKBypass
    {
    public:
        /** Creates an instance of the ITKBypass. */
        ITKBypass();
        
        /** Destructor for the object. */
        virtual ~ITKBypass();
        
        /**
           Indicates if the bypass was set appropriately.
           
           @returns 
           <ul>
           <li>#ITK_ok if the bypass has been set.
           <li>#SA_not_a_system_administrator if the current user is not a system administrator
           <li>Possible other errors if the bypass was not set correctly
           </ul>
        */
        int isBypassSet();
        
    private:
        /** Preventing copy construction. */
        ITKBypass( const ITKBypass &  other );
        
        /** Preventing assignment. */
        ITKBypass &  operator=( const ITKBypass &  other );
        
        /** The status code, when the bypass was set. */
        int m_statusCode;
        
        /** Indicates if a bypass was already in place when this bypass was created. */
        logical m_bypassWasAlreadyOn;
    };
}
#include <fclasses/libfclasses_undef.h>
#endif

