Click or drag to resize

ControllerStandardDataItemClassPermissionCheck Method

Check Permission with array of CRUD (enumeration)

Namespace:  SOWIWeb.Helper
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected bool PermissionCheck(
	CRUD[] pClaim
)

Parameters

pClaim
Type: SOWIData.ManagementCRUD

[Missing <param name="pClaim"/> documentation for "M:SOWIWeb.Helper.ControllerStandard`1.PermissionCheck(SOWIData.Management.CRUD[])"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:SOWIWeb.Helper.ControllerStandard`1.PermissionCheck(SOWIData.Management.CRUD[])"]

Remarks
Requirement exist AppModule object then check permission with method AppModule.PermissionCheck else back no permission (false)
Examples
Use method PermissionCheck in a MVC controller action
protected virtual ActionResult EditOnActionResultPostSave(ref DataItemClass pItem)
{
    var lClaim = new SOWIData.Management.CRUD[] { SOWIData.Management.CRUD.Update, SOWIData.Management.CRUD.UpdateOwner };
    if (PermissionCheck(lClaim))
    {
        // to do
        return View(pItem);
    }
    return PermissionDenied();
}
See Also