Exemple #1
0
        /// <summary>
        /// 初始化授權結果
        /// </summary>
        protected virtual void InitialAuthorizationResult(bool isTopPageOfOperation)
        {
            this.isTopPageOfOperation = isTopPageOfOperation;

            using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
            {
                //取得指定作業代碼的後端身分可使用權限
                EmployeeRoleOperationsDesc roleOp = empAuthDao.GetEmployeeRoleOperationsDescDataOfOp(roleName, opIdOfPage);

                //從資料集載入身分的授權設定
                LoadRoleAuthorizationsFrom(roleOp);
            }

            if (custEmpAuthResult != null)
            {
                //自訂帳號授權結果
                EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = custEmpAuthResult.InitialAuthorizationResult(isTopPageOfOperation, authorizations);
                ownerAccountOfDataExamined = authAndOwner.OwnerAccountOfDataExamined;
                ownerDeptIdOfDataExamined  = authAndOwner.OwnerDeptIdOfDataExamined;
                this.authorizations        = authAndOwner;

                if (authAndOwner.IsTopPageOfOperationChanged)
                {
                    this.isTopPageOfOperation = authAndOwner.IsTopPageOfOperation;
                }

                return;
            }
        }
Exemple #2
0
 /// <summary>
 /// 授權項目與目標資料的擁有者資訊
 /// </summary>
 public EmployeeAuthorizationsWithOwnerInfoOfDataExamined(EmployeeAuthorizations authorizations)
     : base()
 {
     CanRead = authorizations.CanRead;
     CanEdit = authorizations.CanEdit;
     CanReadSubItemOfSelf   = authorizations.CanReadSubItemOfSelf;
     CanEditSubItemOfSelf   = authorizations.CanEditSubItemOfSelf;
     CanAddSubItemOfSelf    = authorizations.CanAddSubItemOfSelf;
     CanDelSubItemOfSelf    = authorizations.CanDelSubItemOfSelf;
     CanReadSubItemOfCrew   = authorizations.CanReadSubItemOfCrew;
     CanEditSubItemOfCrew   = authorizations.CanEditSubItemOfCrew;
     CanDelSubItemOfCrew    = authorizations.CanDelSubItemOfCrew;
     CanReadSubItemOfOthers = authorizations.CanReadSubItemOfOthers;
     CanEditSubItemOfOthers = authorizations.CanEditSubItemOfOthers;
     CanDelSubItemOfOthers  = authorizations.CanDelSubItemOfOthers;
 }
Exemple #3
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    DepartmentForBackend dept = empAuthDao.GetDepartmentDataForBackend(qsId);
                    string dbErrMsg           = empAuthDao.GetErrMsg();

                    if (dept != null)
                    {
                        authAndOwner.OwnerAccountOfDataExamined = dept.PostAccount ?? "";
                        authAndOwner.OwnerDeptIdOfDataExamined  = dept.PostDeptId;
                    }
                }
            }

            return(authAndOwner);
        }
Exemple #4
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                EmployeeRoleForBackend empRole = null;

                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    empRole = empAuthDao.GetEmployeeRoleDataForBackend(qsRoleId);
                    string dbErrMsg = empAuthDao.GetErrMsg();
                }

                if (empRole != null)
                {
                    authAndOwner.OwnerAccountOfDataExamined = empRole.PostAccount;
                    authAndOwner.OwnerDeptIdOfDataExamined  = empRole.PostDeptId.Value;
                }
            }

            return(authAndOwner);
        }
Exemple #5
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    string empAccount = empAuthDao.GetEmployeeAccountOfId(qsEmpId);
                    string dbErrMsg   = empAuthDao.GetErrMsg();

                    if (!string.IsNullOrEmpty(empAccount))
                    {
                        accountOfData = empAccount;

                        EmployeeForBackend empData = empAuthDao.GetEmployeeDataForBackend(empAccount);
                        dbErrMsg = empAuthDao.GetErrMsg();

                        if (empData != null)
                        {
                            authAndOwner.OwnerAccountOfDataExamined = empData.OwnerAccount;
                            authAndOwner.OwnerDeptIdOfDataExamined  = empData.OwnerDeptId;
                        }
                    }
                }
            }

            return(authAndOwner);
        }
Exemple #6
0
 /// <summary>
 /// 帳號與權限
 /// </summary>
 public EmployeeAuthorityLogic()
 {
     this.authorizations = new EmployeeAuthorizations();
     logger = LogManager.GetLogger(this.GetType());
 }