Beispiel #1
0
        public string UpdateDescription(int boardId, int cardId, string description)
        {
            if (!User.CheckSecurity(boardId))
            {
                return(AccessDenied());
            }

            //check description for malicious input
            if (Malicious.IsMalicious(description, Malicious.InputType.TextOnly) == true)
            {
                return(Error());
            }

            var query = new Query.Cards();

            try
            {
                query.UpdateDescription(boardId, cardId, description);
                return(GetCard(boardId, cardId));
            }
            catch (Exception)
            {
                return(Error());
            }
        }
Beispiel #2
0
        public string UpdateDescription(int boardId, int cardId, string description)
        {
            //check security
            var board = Query.Boards.GetInfo(boardId);

            if (!User.CheckSecurity(board.orgId, new string[] { Security.Keys.CardFullAccess.ToString(), Security.Keys.CardCanUpdate.ToString() }, Models.Scope.Card, cardId) ||
                !User.CheckSecurity(board.orgId, new string[] { Security.Keys.BoardsFullAccess.ToString(), Security.Keys.BoardCanUpdate.ToString() }, Models.Scope.Board, boardId)
                )
            {
                return(AccessDenied());
            }

            //check description for malicious input
            if (Malicious.IsMalicious(description, Malicious.InputType.TextOnly) == true)
            {
                return(Error());
            }

            //save description
            try
            {
                Query.Cards.UpdateDescription(boardId, cardId, description);
                return(GetCard(boardId, cardId));
            }
            catch (Exception)
            {
                return(Error());
            }
        }
Beispiel #3
0
        public string UpdateName(int boardId, int cardId, string name)
        {
            if (!User.CheckSecurity(boardId))
            {
                return(AccessDenied());
            }

            //check description for malicious input
            if (Malicious.IsMalicious(name, Malicious.InputType.TextOnly) == true)
            {
                return(Error());
            }

            try
            {
                Query.Cards.UpdateName(boardId, cardId, name);
                return(GetCard(boardId, cardId));
            }
            catch (Exception)
            {
                return(Error());
            }
        }