access-rule: Make user can see original content text
Now, users with read permission can view original text. It is useful when someone want to see text and copy it.
@691986cac111fbc8b3dc242858b9db5f97359581
--- app/assets/stylesheets/less/_yobiUI.less
+++ app/assets/stylesheets/less/_yobiUI.less
... | ... | @@ -1135,8 +1135,8 @@ |
1135 | 1135 |
background:transparent; |
1136 | 1136 |
border:0; |
1137 | 1137 |
outline:none; |
1138 |
- font-size:0px; |
|
1139 |
- line-height:normal; |
|
1138 |
+ font-size:0; |
|
1139 |
+ line-height:20px; |
|
1140 | 1140 |
} |
1141 | 1141 |
|
1142 | 1142 |
.numberic { |
--- app/controllers/BoardApp.java
+++ app/controllers/BoardApp.java
... | ... | @@ -261,7 +261,7 @@ |
261 | 261 |
Project project = Project.findByOwnerAndProjectName(owner, projectName); |
262 | 262 |
Posting posting = Posting.findByNumber(project, number); |
263 | 263 |
|
264 |
- if (!AccessControl.isAllowed(UserApp.currentUser(), posting.asResource(), Operation.UPDATE)) { |
|
264 |
+ if (!AccessControl.isAllowed(UserApp.currentUser(), posting.asResource(), Operation.READ)) { |
|
265 | 265 |
return forbidden(ErrorViews.Forbidden.render("error.forbidden", project)); |
266 | 266 |
} |
267 | 267 |
|
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
... | ... | @@ -468,7 +468,7 @@ |
468 | 468 |
Project project = Project.findByOwnerAndProjectName(ownerName, projectName); |
469 | 469 |
Issue issue = Issue.findByNumber(project, number); |
470 | 470 |
|
471 |
- if (!AccessControl.isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { |
|
471 |
+ if (!AccessControl.isAllowed(UserApp.currentUser(), issue.asResource(), Operation.READ)) { |
|
472 | 472 |
return forbidden(ErrorViews.Forbidden.render("error.forbidden", project)); |
473 | 473 |
} |
474 | 474 |
|
--- app/views/board/edit.scala.html
+++ app/views/board/edit.scala.html
... | ... | @@ -86,7 +86,8 @@ |
86 | 86 |
</label> |
87 | 87 |
</span> |
88 | 88 |
} |
89 |
- <button class="ybtn ybtn-info" tabindex="3">@Messages("button.save")</button><!-- |
|
89 |
+ @if(isAllowed(UserApp.currentUser(), posting.asResource(), Operation.UPDATE)) { |
|
90 |
+ <button class="ybtn ybtn-info" tabindex="3">@Messages("button.save")</button>}<!-- |
|
90 | 91 |
--><a href="javascript:history.back();" class="ybtn" tabindex="4">@Messages("button.cancel")</a> |
91 | 92 |
</div> |
92 | 93 |
</div> |
--- app/views/board/partial_comments.scala.html
+++ app/views/board/partial_comments.scala.html
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 |
<a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
60 | 60 |
</span> |
61 | 61 |
<span class="act-row pull-right"> |
62 |
- @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { |
|
62 |
+ @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ)) { |
|
63 | 63 |
<button type="button" class="btn-transparent mr10" data-toggle="comment-edit" data-comment-id="@comment.id" title="@Messages("common.comment.edit")"><i class="yobicon-edit-2"></i></button> |
64 | 64 |
} |
65 | 65 |
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.DELETE)) { |
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
... | ... | @@ -98,6 +98,8 @@ |
98 | 98 |
|
99 | 99 |
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.UPDATE)) { |
100 | 100 |
<a href="@routes.BoardApp.editPostForm(project.owner, project.name, post.getNumber)" class="ybtn">@Messages("button.edit")</a> |
101 |
+ } else { |
|
102 |
+ <a href="@routes.BoardApp.editPostForm(project.owner, project.name, post.getNumber)" class="ybtn">@Messages("button.show.original")</a> |
|
101 | 103 |
} |
102 | 104 |
</div> |
103 | 105 |
<div class="watcher-list"></div> |
--- app/views/common/commentUpdateForm.scala.html
+++ app/views/common/commentUpdateForm.scala.html
... | ... | @@ -1,24 +1,11 @@ |
1 | 1 |
@** |
2 |
-* Yobi, Project Hosting SW |
|
2 |
+* Yona, 21st Century Project Hosting SW |
|
3 | 3 |
* |
4 |
-* Copyright 2014 NAVER Corp. |
|
5 |
-* http://yobi.io |
|
6 |
-* |
|
7 |
-* @author Suwon Chae |
|
8 |
-* |
|
9 |
-* Licensed under the Apache License, Version 2.0 (the "License"); |
|
10 |
-* you may not use this file except in compliance with the License. |
|
11 |
-* You may obtain a copy of the License at |
|
12 |
-* |
|
13 |
-* http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
-* |
|
15 |
-* Unless required by applicable law or agreed to in writing, software |
|
16 |
-* distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
-* See the License for the specific language governing permissions and |
|
19 |
-* limitations under the License. |
|
4 |
+* Copyright Yona & Yobi Authors & NAVER Corp. |
|
5 |
+* https://yona.io |
|
20 | 6 |
**@ |
21 | 7 |
@(comment:Comment, action:String, contents:String) |
8 |
+@import utils.AccessControl._ |
|
22 | 9 |
|
23 | 10 |
<div id="comment-editform-@comment.id" class="comment-update-form"> |
24 | 11 |
<form action="@action" method="post"> |
... | ... | @@ -38,7 +25,9 @@ |
38 | 25 |
</span> |
39 | 26 |
} |
40 | 27 |
<button type="button" class="ybtn ybtn-cancel" data-comment-id="@comment.id">@Messages("button.cancel")</button> |
41 |
- <button type="submit" class="ybtn ybtn-info">@Messages("button.save")</button> |
|
28 |
+ @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { |
|
29 |
+ <button type="submit" class="ybtn ybtn-info">@Messages("button.save")</button> |
|
30 |
+ } |
|
42 | 31 |
</div> |
43 | 32 |
</div> |
44 | 33 |
</div> |
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
... | ... | @@ -79,7 +79,8 @@ |
79 | 79 |
</label> |
80 | 80 |
</span> |
81 | 81 |
} |
82 |
- <button type="submit" class="ybtn ybtn-info">@Messages("button.save")</button><!-- |
|
82 |
+ @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { |
|
83 |
+ <button type="submit" class="ybtn ybtn-info">@Messages("button.save")</button>}<!-- |
|
83 | 84 |
--><a href="javascript:history.back();" class="ybtn">@Messages("button.cancel")</a> |
84 | 85 |
</div> |
85 | 86 |
</div> |
--- app/views/issue/partial_comments.scala.html
+++ app/views/issue/partial_comments.scala.html
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 |
} |
140 | 140 |
} |
141 | 141 |
|
142 |
- @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { |
|
142 |
+ @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ)) { |
|
143 | 143 |
<button type="button" class="btn-transparent-with-fontsize-lineheight ml10" data-toggle="comment-edit" data-comment-id="@comment.id" title="@Messages("common.comment.edit")"><i class="yobicon-edit-2"></i></button> |
144 | 144 |
} |
145 | 145 |
|
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
... | ... | @@ -150,6 +150,8 @@ |
150 | 150 |
|
151 | 151 |
@if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { |
152 | 152 |
<a href="@routes.IssueApp.editIssueForm(project.owner, project.name, issue.getNumber)" class="ybtn">@Messages("button.edit")</a> |
153 |
+ } else { |
|
154 |
+ <a href="@routes.IssueApp.editIssueForm(project.owner, project.name, issue.getNumber)" class="ybtn">@Messages("button.show.original")</a> |
|
153 | 155 |
} |
154 | 156 |
</div> |
155 | 157 |
<div class="watcher-list"></div> |
--- conf/messages
+++ conf/messages
... | ... | @@ -67,6 +67,7 @@ |
67 | 67 |
button.save = Save |
68 | 68 |
button.selectAll = Select all |
69 | 69 |
button.selectFile = Select file |
70 |
+button.show.original = See text |
|
70 | 71 |
button.signup = Sign up for {0} |
71 | 72 |
button.submitForm = Submit form |
72 | 73 |
button.upload = File upload |
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
... | ... | @@ -67,6 +67,7 @@ |
67 | 67 |
button.save = 저장 |
68 | 68 |
button.selectAll = 전체 선택 |
69 | 69 |
button.selectFile = 파일 선택 |
70 |
+button.show.original = 원문 보기 |
|
70 | 71 |
button.signup = {0} 시작 하기 |
71 | 72 |
button.submitForm = 폼 전송 |
72 | 73 |
button.upload = 파일 올리기 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?