OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Shared.MPartner.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, bool AIsFoundation, PFoundationRow AFoundationRow)
 Tests whether the current user has access to a particular Partner. More...
 
static void CanAccessPartnerExc (PPartnerRow APartnerRow, bool AIsFoundation, PFoundationRow AFoundationRow)
 Tests whether the current user has access to a particular Partner. More...
 
static void AccessLevelExceptionEvaluatorAndThrower (PPartnerRow APartnerRow, TPartnerAccessLevelEnum AAccessLevel)
 Evaluates the passed in AccessLevel and throws ESecurityPartnerAccessDeniedException if the AccessLevel isn't TPartnerAccessLevelEnum.palGranted. More...
 
static bool CheckFoundationSecurity (PFoundationRow AFoundationRow)
 Tests whether the current user has access to a particular Foundation. More...
 
static bool CheckFoundationSecurity (Int64 AFoundationOwner1Key, Int64 AFoundationOwner2Key)
 Tests whether the current user has access to a particular Foundation. More...
 

Static Public Attributes

const byte PARTNER_RESTRICTED_TO_GROUP = 1
 Partner is restricted to a Security Group More...
 
const byte PARTNER_RESTRICTED_TO_USER = 2
 Partner is restricted to a User More...
 

Detailed Description

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

There are other security-related Methods to be found on the server side. Class: Ict.Petra.Server.MParter, Security.cs, Class TSecurity.

Member Function Documentation

◆ AccessLevelExceptionEvaluatorAndThrower()

static void Ict.Petra.Shared.MPartner.TSecurity.AccessLevelExceptionEvaluatorAndThrower ( PPartnerRow  APartnerRow,
TPartnerAccessLevelEnum  AAccessLevel 
)
inlinestatic

Evaluates the passed in AccessLevel and throws ESecurityPartnerAccessDeniedException if the AccessLevel isn't TPartnerAccessLevelEnum.palGranted.

Parameters
APartnerRowPartner for which access should be checked for.
AAccessLevelAccessLevel as determined by caller.

◆ CanAccessPartner()

static TPartnerAccessLevelEnum Ict.Petra.Shared.MPartner.TSecurity.CanAccessPartner ( PPartnerRow  APartnerRow,
bool  AIsFoundation,
PFoundationRow  AFoundationRow 
)
inlinestatic

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

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

A server-side implementation of this Method exists that has only the APartnerRow parameter as an Argument. It looks up the Foundation Row on its own if this is needed.

Parameters
APartnerRowPartner for which access should be checked for.
AIsFoundationSet to true if Partner is a Foundation.
AFoundationRowFoundation Row needs to be passed in if Partner is a Foundation.
Returns
TPartnerAccessLevelEnum.palGranted if access to the Partner is granted, otherwise a different TPartnerAccessLevelEnum value.

◆ CanAccessPartnerExc()

static void Ict.Petra.Shared.MPartner.TSecurity.CanAccessPartnerExc ( PPartnerRow  APartnerRow,
bool  AIsFoundation,
PFoundationRow  AFoundationRow 
)
inlinestatic

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

This Method throws an 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.
AIsFoundationSet to true if Partner is a Foundation.
AFoundationRowFoundation Row needs to be passed in if Partner is a Foundation.
Returns
void
Exceptions
ESecurityPartnerAccessDeniedExceptionThrown if access is not granted.

◆ CheckFoundationSecurity() [1/2]

static bool Ict.Petra.Shared.MPartner.TSecurity.CheckFoundationSecurity ( Int64  AFoundationOwner1Key,
Int64  AFoundationOwner2Key 
)
inlinestatic

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

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

Parameters
AFoundationOwner1KeyPartnerKey of the first owner of the Foundation. Pass in 0 if there is no first owner.
AFoundationOwner2KeyPartnerKey of the second owner of the Foundation Pass in 0 if there is no second owner.
Returns
True if the current user has access to the passed in Foundation, otherwise false.

◆ CheckFoundationSecurity() [2/2]

static bool Ict.Petra.Shared.MPartner.TSecurity.CheckFoundationSecurity ( PFoundationRow  AFoundationRow)
inlinestatic

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

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

Parameters
AFoundationRowFoundation row to check for.
Returns
True if the current user has access to the passed in Foundation, otherwise false.

Member Data Documentation

◆ PARTNER_RESTRICTED_TO_GROUP

const byte Ict.Petra.Shared.MPartner.TSecurity.PARTNER_RESTRICTED_TO_GROUP = 1
static

Partner is restricted to a Security Group

◆ PARTNER_RESTRICTED_TO_USER

const byte Ict.Petra.Shared.MPartner.TSecurity.PARTNER_RESTRICTED_TO_USER = 2
static

Partner is restricted to a User


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