OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MPartner.Common.TSecurity Class Reference

Contains security-related functions for Partners that that can be used by any Class. More...

Static Public Member Functions

static TPartnerAccessLevelEnum CanAccessPartner (PPartnerRow APartnerRow, TDataBase ADataBase=null)
 Tests whether the current user has access to a particular Partner. More...
 
static void CanAccessPartnerExc (PPartnerRow APartnerRow, TDataBase ADataBase=null)
 Tests whether the current user has access to a particular Partner. More...
 
static TPartnerAccessLevelEnum CanAccessPartnerByKey (Int64 APartnerKey, bool AThrowExceptionIfDenied, TDataBase ADataBase=null)
 Tests whether the current user has access to a particular Partner. More...
 

Detailed Description

Contains security-related functions for Partners that that can be used by any Class.

Note: There are other security-related Methods to be found in Shared. Class: Ict.Petra.Shared.MParter, Security.cs, Class TSecurity.

Member Function Documentation

◆ CanAccessPartner()

static TPartnerAccessLevelEnum Ict.Petra.Server.MPartner.Common.TSecurity.CanAccessPartner ( PPartnerRow  APartnerRow,
TDataBase  ADataBase = null 
)
inlinestatic

Tests whether the current user has access to a particular Partner.

Corresponds to Progress 4GL Method 'CanAccessPartner' in common/sp_partn.p

A shared implementation of this Method exists that has two additional Arguments. It needs the Foundation Row to be passed in, but has the advantage of not needing a Server roundtrip for a DB lookup!

Parameters
APartnerRowPartner for which access should be checked for.
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection
Returns
T:TPartnerAccessLevelEnum.palGranted if access to the Partner is granted, otherwise a different T:TPartnerAccessLevelEnum value.

◆ CanAccessPartnerByKey()

static TPartnerAccessLevelEnum Ict.Petra.Server.MPartner.Common.TSecurity.CanAccessPartnerByKey ( Int64  APartnerKey,
bool  AThrowExceptionIfDenied,
TDataBase  ADataBase = null 
)
inlinestatic

Tests whether the current user has access to a particular Partner.

Corresponds to Progress 4GL Method 'CanAccessPartner' in common/sp_partn.p

Parameters
APartnerKeyPartnerKey of Partner for which access should be checked for.
AThrowExceptionIfDenied
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection
Returns
TPartnerAccessLevelEnum.palGranted if access to the Partner is granted (or Partner doesn't exist), otherwise a different TPartnerAccessLevelEnum value.

◆ CanAccessPartnerExc()

static void Ict.Petra.Server.MPartner.Common.TSecurity.CanAccessPartnerExc ( PPartnerRow  APartnerRow,
TDataBase  ADataBase = null 
)
inlinestatic

Tests whether the current user has access to a particular Partner.

This Method throws an T:ESecurityPartnerAccessDeniedException if access to the Partner is not granted, thereby ensuring that a denied access doesn't go unnoticed.

Parameters
APartnerRowPartner for which access should be checked for.
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection
Exceptions
T:ESecurityPartnerAccessDeniedExceptionThrown if access is not granted.

The documentation for this class was generated from the following file: