Client CameraAccounts new permission added
This commit is contained in:
@@ -385,11 +385,27 @@
|
||||
/// </summary>
|
||||
public const int SetWorkshopWorkingHoursPermissionCode = 10606;
|
||||
|
||||
#region حساب کاربری دوربین
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات حساب کاربری دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountSettingsPermissionCode = 10607;
|
||||
|
||||
/// <summary>
|
||||
/// فعال/غیرفعال اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountActivationBtnPermissionCode = 1060701;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountEditPermissionCode = 1060702;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region کارپوشه
|
||||
@@ -744,6 +760,22 @@
|
||||
Code = CameraAccountSettingsPermissionCode,
|
||||
ParentId = RollCallOperationsPermissionCode
|
||||
};
|
||||
|
||||
public static SubAccountPermissionDto CameraAccountActivationBtn { get; } = new()
|
||||
{
|
||||
Id = CameraAccountActivationBtnPermissionCode,
|
||||
Name = "فعال/غیرفعال حساب کاربری دوربین",
|
||||
Code = CameraAccountActivationBtnPermissionCode,
|
||||
ParentId = CameraAccountSettingsPermissionCode
|
||||
};
|
||||
|
||||
public static SubAccountPermissionDto CameraAccountEdit { get; } = new()
|
||||
{
|
||||
Id = CameraAccountEditPermissionCode,
|
||||
Name = "ویراش حساب کاربری دوربین",
|
||||
Code = CameraAccountEditPermissionCode,
|
||||
ParentId = CameraAccountSettingsPermissionCode
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
|
||||
|
||||
@inject _0_Framework.Application.IAuthHelper authHelper
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین";
|
||||
@@ -207,6 +209,9 @@
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
||||
|
||||
var hasActiveDeActvePersmission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountActivationBtnPermissionCode) ? "true" : "false");
|
||||
var hasEditCameraAccountPermission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountEditPermissionCode) ? "true" : "false");
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -61,7 +61,7 @@ function loadDataCameraAccountAjax() {
|
||||
|
||||
<div class="Rtable-cell d-md-flex d-none justify-content-center width5">
|
||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex text-end me-3">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||
<span class="mx-1 df">فعال</span>
|
||||
<label class="switch">
|
||||
<input type="checkbox"
|
||||
@@ -77,14 +77,26 @@ function loadDataCameraAccountAjax() {
|
||||
|
||||
<div class="Rtable-cell d-md-flex justify-content-end width6">
|
||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex justify-content-end">
|
||||
<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
||||
|
||||
${hasEditCameraAccountPermission ?
|
||||
`<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
</button>`
|
||||
:
|
||||
`<button class="btn-pass ChangePassword d-none d-md-block disable" type="button">
|
||||
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
}
|
||||
|
||||
<button type="button" class="btn-more position-relative d-md-none d-flex" style="width: 36px;padding: 0;height: 36px;align-items: center;justify-content: center;position: relative !important;">
|
||||
<span class="mx-1 align-items-center d-flex justify-content-center"></span>
|
||||
@@ -109,7 +121,7 @@ function loadDataCameraAccountAjax() {
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between my-1">
|
||||
<span class="span1">وضعیت:</span>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||
<span class="span1 mx-1 df">فعال</span>
|
||||
<label class="switch">
|
||||
<input type="checkbox"
|
||||
@@ -133,14 +145,25 @@ function loadDataCameraAccountAjax() {
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
${hasEditCameraAccountPermission ?
|
||||
`<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
:
|
||||
`<button class="btn-pass ChangePassword w-100 disable" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user