Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d4e58e2f1 | ||
|
|
385e77f189 | ||
|
|
d1fd2b6984 |
No files matched your search
@@ -15,8 +15,13 @@ class ObjectAuth < PrototypeAuth
|
||||
end
|
||||
|
||||
def check_user_has_can_access_app
|
||||
sub_managing_users = auth_obj.module_app.sub_managing_users rescue []
|
||||
module_app = auth_obj.module_app
|
||||
if auth_obj["_type"] == "PageContext"
|
||||
module_app = ModuleApp.where(:key=>'page_content').first
|
||||
sub_managing_users = module_app.sub_managing_users rescue []
|
||||
else
|
||||
sub_managing_users = auth_obj.module_app.sub_managing_users rescue []
|
||||
module_app = auth_obj.module_app
|
||||
end
|
||||
self.auth_users.each do |auth_user|
|
||||
if !sub_managing_users.include? auth_user && !auth_user.admin?
|
||||
module_app.assign_sub_manager(auth_user,User.current)
|
||||
|
||||
@@ -55,6 +55,16 @@ class PrototypeAuth
|
||||
if (self.send item).include? obj.id
|
||||
(self.send item).delete obj.id
|
||||
self.save!
|
||||
|
||||
if auth_obj["_type"] == "PageContext"
|
||||
module_app = ModuleApp.where(:key=>'page_content').first
|
||||
else
|
||||
module_app = auth_obj.module_app
|
||||
end
|
||||
|
||||
module_app.remove_sub_manager(obj)
|
||||
module_app.save
|
||||
|
||||
else
|
||||
false #should put error message for user not existed in list
|
||||
end
|
||||
|
||||
Vendored
+3
-10
@@ -44,15 +44,8 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @bulletin.user_ids.blank? %>
|
||||
<div class="promoter">
|
||||
<div>
|
||||
<p><%= t(:promoter) %>:</p>
|
||||
<span><%= @bulletin.get_users.map{|u| "<span>#{u.name}</span>"}.join(', ').html_safe %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= share_links(@bulletin, 'announcement') %>
|
||||
|
||||
<%= render partial: 'admin/member_selects/promoter_front', locals: {users: @bulletin.get_users} %>
|
||||
<% unless @bulletin.user_ids.blank? %>
|
||||
<%= render partial: 'admin/member_selects/promoter_front', locals: {users: @bulletin.get_users} %>
|
||||
<% end %>
|
||||
Vendored
+4
-4
@@ -8,15 +8,15 @@
|
||||
<tr>
|
||||
<th class="column-ctrl col-title"><%= sortable(:title, t("archive.Title"))%></th>
|
||||
<th class="column-ctrl col-file"><%= t("archive.Files")%></th>
|
||||
<th class="column-ctrl col-file"><%= t(:promoter)%></th>
|
||||
<th class="column-ctrl col-promoter"><%= t(:promoter)%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<% @archive_files.each_with_index do |post,i| %>
|
||||
<tr <% if ( (i + 1) % 2 ) == 0 %> class="even" <% end %>>
|
||||
<td><div class="o-archives-title"><%= post.title %></div></td>
|
||||
<td>
|
||||
<td class="col-title"><div class="o-archives-title"><%= post.title %></div></td>
|
||||
<td class="col-file">
|
||||
<div class="o-archives-list-item">
|
||||
<% if !post.archive_file_multiples.blank? %>
|
||||
<ol>
|
||||
@@ -32,7 +32,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<td class="col-promoter">
|
||||
<% unless post.get_users.blank? %>
|
||||
<div class="promoter-block">
|
||||
<ul>
|
||||
|
||||
+2
@@ -85,7 +85,9 @@ $(document).ready(function(){
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<%= f.label t('ask.validate_code'), class: 'control-label required' %>
|
||||
<div class="controls">
|
||||
<label><%= t('ask.validate_code_note') %></label>
|
||||
<%= gotcha_error %>
|
||||
<%= gotcha%>
|
||||
</div>
|
||||
|
||||
@@ -18,6 +18,8 @@ en:
|
||||
admin: Administrator
|
||||
new_question: New question
|
||||
pending: Pending
|
||||
validate_code: Verification code
|
||||
validate_code_note: Please answer the following verification questions.
|
||||
mongoid:
|
||||
attributes:
|
||||
ask_question:
|
||||
|
||||
@@ -23,6 +23,8 @@ zh_tw:
|
||||
admin: 管理者
|
||||
new_question: 新的發問
|
||||
pending: 待處理
|
||||
validate_code: 驗證碼
|
||||
validate_code_note: 請回答下列驗證問句。
|
||||
mongoid:
|
||||
attributes:
|
||||
ask_question:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ class Panel::PageContent::BackEnd::PageContextsController < OrbitBackendControll
|
||||
before_filter :force_order_for_visitor,:only=>[:index]
|
||||
before_filter :force_order_for_user,:except => [:index]
|
||||
|
||||
before_filter :for_app_manager,:except => [:index]
|
||||
# before_filter :for_app_manager,:except => [:index]
|
||||
before_filter :for_app_sub_manager,:except => [:index]
|
||||
|
||||
#before_filter :is_admin?
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<%= page_context.page.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<%if is_manager? || is_admin? || page_context.authed_users(:edit).include?(current_user)%>
|
||||
<%if is_manager? || is_admin? || page_context.authed_users("Edit").include?(current_user)%>
|
||||
<li><%= link_to t(:edit), edit_panel_page_content_back_end_page_context_path(page_context, page: params[:page], sort: params[:sort], direction: params[:direction], sort_options: params[:sort_options]) %></li>
|
||||
<%if (is_manager? || is_admin?) %>
|
||||
<li><%=show_page_context_edit_auth_link page_context%></li>
|
||||
|
||||
Reference in new issue
Block a user