Exemple #1
0
        private bool updateAuthenticatedUserCredentialsOnActions(List <RoleModel> roles)
        {
            bool  isUpdateSuccessful = false;
            Agent authenticatedUser  = Bl.BlSecurity.GetAuthenticatedUser();

            foreach (RoleModel roleModel in roles)
            {
                Role authenticatedUserRole = authenticatedUser.RoleList.Where(x => x.Name.Equals(roleModel.Role.Name)).FirstOrDefault();
                if (authenticatedUserRole != null)
                {
                    Entity.Action authenticatedUserAction = (from r in authenticatedUser.RoleList.GroupBy(x => x.ActionList.Where(y => y.Name.Equals(roleModel.ActionModel.TxtName)).Count() > 0).Select(x => x.First()).ToList()
                                                             from a in r.ActionList
                                                             where a.Name == roleModel.ActionModel.TxtName
                                                             select a).FirstOrDefault();
                    if (authenticatedUserAction != null)
                    {
                        authenticatedUserAction.Right.IsDelete = roleModel.ActionModel.PrivilegeModel.IsDelete;
                        authenticatedUserAction.Right.IsRead   = roleModel.ActionModel.PrivilegeModel.IsRead;
                        authenticatedUserAction.Right.IsUpdate = roleModel.ActionModel.PrivilegeModel.IsUpdate;
                        authenticatedUserAction.Right.IsWrite  = roleModel.ActionModel.PrivilegeModel.IsWrite;
                        isUpdateSuccessful = true;
                    }
                }
            }
            return(isUpdateSuccessful);
        }
Exemple #2
0
        public async Task <List <QOBDCommon.Entities.Action> > searchActionAsync(QOBDCommon.Entities.Action Action, ESearchOption filterOperator)
        {
            List <QOBDCommon.Entities.Action> result = new List <QOBDCommon.Entities.Action>();

            try
            {
                result = await DAC.DALSecurity.searchActionAsync(Action, filterOperator);
            }
            catch (Exception ex) { Log.error(ex.Message, EErrorFrom.SECURITY); }
            return(result);
        }
Exemple #3
0
        public async Task <List <QOBDCommon.Entities.Action> > searchActionAsync(QOBDCommon.Entities.Action Action, ESearchOption filterOperator)
        {
            List <QOBDCommon.Entities.Action> result = new List <QOBDCommon.Entities.Action>();

            try
            {
                result = (await _channel.get_filter_actionAsync(_companyName, Action.ActionTypeToFilterArray(filterOperator))).ArrayTypeToAction();
            }
            catch (FaultException) { Dispose(); throw; }
            catch (CommunicationException) { _channel.Abort(); throw; }
            catch (TimeoutException) { _channel.Abort(); }
            return(result);
        }
Exemple #4
0
 public ActionModel()
 {
     _action         = new Entity.Action();
     _privilegeModel = new PrivilegeModel();
 }
Exemple #5
0
 public async Task <List <QOBDCommon.Entities.Action> > searchActionAsync(QOBDCommon.Entities.Action Action, ESearchOption filterOperator)
 {
     checkServiceCommunication();
     return(await _gateWaySecurity.searchActionAsync(Action, filterOperator));
 }