add SetBoardMemberPermission
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Raffaele Mignone 2019-11-09 23:57:15 +01:00
parent f4df78dc73
commit 991b19a1b8
Signed by: norangebit
GPG Key ID: F5255658CB220573
2 changed files with 42 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package wekan.wrapper.api;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.*; import retrofit2.http.*;
import wekan.wrapper.entity.Board; import wekan.wrapper.entity.Board;
import wekan.wrapper.entity.MemberPermission;
import wekan.wrapper.entity.BoardPrototype; import wekan.wrapper.entity.BoardPrototype;
import java.util.List; import java.util.List;
@ -20,6 +21,13 @@ public interface BoardService {
@DELETE("api/boards/{boardId}") @DELETE("api/boards/{boardId}")
Call<Void> deleteBoard(@Path("boardId") String boardId); Call<Void> deleteBoard(@Path("boardId") String boardId);
@POST("/api/boards/{boardId}/members/{memberId}")
Call<Void> setBoardMemberPermission(
@Path("boardId") String board,
@Path("memberId") String member,
@Body MemberPermission memberPermission
);
@GET("api/users/{userId}/boards") @GET("api/users/{userId}/boards")
Call<List<Board>> getBoardsFromUser(@Path("userId") String userId); Call<List<Board>> getBoardsFromUser(@Path("userId") String userId);
} }

View File

@ -0,0 +1,34 @@
package wekan.wrapper.entity;
public class MemberPermission {
public final static MemberPermission ADMIN = new MemberPermission(
true,
false,
false
);
public final static MemberPermission NORMAL = new MemberPermission(
false,
false,
false
);
public final static MemberPermission NO_COMMENTS = new MemberPermission(
false,
true,
false
);
public final static MemberPermission COMMENT_ONLY = new MemberPermission(
false,
false,
true
);
private boolean isAdmin;
private boolean isNoComments;
private boolean isCommentOnly;
private MemberPermission(boolean isAdmin, boolean isNoComments, boolean isCommentOnly) {
this.isAdmin = isAdmin;
this.isNoComments = isNoComments;
this.isCommentOnly = isCommentOnly;
}
}