示例#1
0
 public static bool IsAllowedToDelete(UserInformationModel<User> aCurrentUser, Board aBoardMessage)
 {
     return aCurrentUser !=null
         && (aCurrentUser.Details.Id == aBoardMessage.OwnerUserId
         || aCurrentUser.Details.Id == aBoardMessage.PostedUserId
         || PermissionHelper<User>.AllowedToPerformAction(aCurrentUser, SocialPermission.Delete_Any_Board_Message));
 }
示例#2
0
 public static string BoardDetailsUrl(Board aBoard)
 {
     return "/Board/Details/" + aBoard.Id;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Boards EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBoards(Board board)
 {
     base.AddObject("Boards", board);
 }
 /// <summary>
 /// Create a new Board object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="ownerUserId">Initial value of the OwnerUserId property.</param>
 /// <param name="postedUserId">Initial value of the PostedUserId property.</param>
 /// <param name="message">Initial value of the Message property.</param>
 /// <param name="dateTimeStamp">Initial value of the DateTimeStamp property.</param>
 /// <param name="deleted">Initial value of the Deleted property.</param>
 public static Board CreateBoard(global::System.Int32 id, global::System.Int32 ownerUserId, global::System.Int32 postedUserId, global::System.String message, global::System.DateTime dateTimeStamp, global::System.Boolean deleted)
 {
     Board board = new Board();
     board.Id = id;
     board.OwnerUserId = ownerUserId;
     board.PostedUserId = postedUserId;
     board.Message = message;
     board.DateTimeStamp = dateTimeStamp;
     board.Deleted = deleted;
     return board;
 }