Guest User

Untitled

a guest
May 8th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.21 KB | None | 0 0
  1. commit 2e2324386efa4222ee9f5ce1309c0611188a209e
  2. Author: Tinu Cleatus <tinu.cleatus@bltsol.com>
  3. Date: Fri Nov 28 19:39:18 2008 +0530
  4.  
  5. Implemented watcher permission for private spaces. Re #2999
  6.  
  7. diff --git a/app/helpers/spaces/users_helper.rb b/app/helpers/spaces/users_helper.rb
  8. index 1973f4e..960a640 100644
  9. --- a/app/helpers/spaces/users_helper.rb
  10. +++ b/app/helpers/spaces/users_helper.rb
  11. @@ -9,7 +9,7 @@ module Spaces::UsersHelper
  12. if user_role.owner?
  13. links << demote_link(@space.id, user_role.id) if count_owners > 1 && user_role.user!=current_user
  14. else
  15. - links << demote_link(@space.id, user_role.id) if (@space.public? ? !user_role.watcher? : !user_role.member?)
  16. + links << demote_link(@space.id, user_role.id) if (!@space.blank? ? !user_role.watcher? : !user_role.member?)
  17. end
  18.  
  19. links << remind_link(user_role.user) if user_role.status == UserRole::INVITED
  20. diff --git a/app/models/space.rb b/app/models/space.rb
  21. index 229929d..acda72e 100644
  22. --- a/app/models/space.rb
  23. +++ b/app/models/space.rb
  24. @@ -166,6 +166,7 @@ class Space < ActiveRecord::Base
  25.  
  26. PERMISSION_SELECTOR_PUBLIC = Array.new(PERMISSION_SELECTOR[0..-2]).freeze
  27. PERMISSION_SELECTOR_TEAM = Array.new(PERMISSION_SELECTOR[1..-1]).freeze
  28. + PERMISSION_SELECTOR_WATCHER = Array.new(PERMISSION_SELECTOR[1..1]).freeze
  29.  
  30. # Values for the spaces_spaces relationships. This list will be added to.
  31. RELATION_NAMES = ['TRUSTS']
  32. @@ -221,6 +222,7 @@ class Space < ActiveRecord::Base
  33. self.can_apply = true if self.can_apply.nil?
  34. self.moderated = false if self.moderated.nil?
  35. self.wiki_format ||= HtmlFormat::FORMAT_HTML
  36. + self.watcher_permission_level = PERMISSION_VIEW
  37. self.name ||= 'New Space'
  38. end
  39.  
  40. @@ -270,7 +272,7 @@ class Space < ActiveRecord::Base
  41.  
  42. PERMISSION_SELECTOR_PUBLIC[idx..-1]
  43. end
  44. -
  45. +
  46. # return the correct permission level for a given user
  47. # this uses a set of rules which may be changed by subclasses
  48. # we need good unit tests for the cases that are implemented here
  49. @@ -299,17 +301,23 @@ class Space < ActiveRecord::Base
  50. rez = self.team_permissions
  51. role = UserRole::ROLE_MEMBER
  52. else
  53. - # role = UserRole::ROLE_WATCHER
  54. - rez = self.public_permissions
  55. +
  56. + if user_roles.detect{|ur| ur['role'].to_i >= UserRole::ROLE_WATCHER }
  57. + rez = self.watcher_permission_level
  58. + role = UserRole::ROLE_WATCHER
  59. + else
  60. + # role = UserRole::ROLE_WATCHER
  61. + rez = self.public_permissions
  62. + puts "REZ IS #{rez}"
  63. + end
  64. end
  65. end
  66. end
  67. -
  68. - # logger.debug("Space perms: #{name}, user:#{user.login}, perms:#{rez}")
  69. - user.set_permission(self.id, rez) #save it for later
  70. - user.set_role_cache(self.id, role)
  71. - rez
  72. - end
  73. + # logger.debug("Space perms: #{name}, user:#{user.login}, perms:#{rez}")
  74. + user.set_permission(self.id, rez) #save it for later
  75. + user.set_role_cache(self.id, role)
  76. + rez
  77. + end
  78.  
  79. def small_user_roles user_id
  80. con = Space.connection
  81. @@ -487,12 +495,8 @@ AND (user_roles.space_id = #{con.quote self.id}
  82. else
  83. errors.add(:user_roles, _("%{fn} Cannot demote the only owner of the space"))
  84. end
  85. - when UserRole::ROLE_MEMBER
  86. - if self.public_permissions == PERMISSION_NONE
  87. - errors.add(:user_roles, _("%{fn} Cannot set user role to watcher when the space is set to private"))
  88. - else
  89. - user_role.role = UserRole::ROLE_WATCHER
  90. - end
  91. + when UserRole::ROLE_MEMBER
  92. + user_role.role = UserRole::ROLE_WATCHER
  93. end
  94. end
  95. user_role.save if errors.empty?
  96. diff --git a/app/views/spaces/_invitationform.rhtml b/app/views/spaces/_invitationform.rhtml
  97. index b783138..145aed0 100644
  98. --- a/app/views/spaces/_invitationform.rhtml
  99. +++ b/app/views/spaces/_invitationform.rhtml
  100. @@ -22,16 +22,21 @@
  101.  
  102. <legend><%= _("Role")%>
  103. </legend>
  104. -
  105. - <% if params[:role] == UserRole::ROLE_OWNER
  106. - memberChecked = ""
  107. - ownerChecked = "checked"
  108. +
  109. + <%-
  110. + if params[:role] == UserRole::ROLE_OWNER
  111. + memberChecked = ""
  112. + ownerChecked = "checked"
  113. + elsif params[:role] == UserRole::ROLE_MEMBER
  114. + memberChecked = "checked"
  115. else
  116. - memberChecked = "checked"
  117. - end %>
  118. -
  119. - <label><input type="radio" id="rmember" name="role" value="<%= UserRole::ROLE_MEMBER %>" <%= memberChecked %>>&nbsp;<%= _("Member")%></label>
  120. - <label><input type="radio" id="rowner" name="role" value="<%= UserRole::ROLE_OWNER %>" <%= ownerChecked %>> <%= _("Owner")%></label>
  121. + watcherChecked = "checked"
  122. + end
  123. + -%>
  124. + <label><input type="radio" id="rowner" name="role" value="<%= UserRole::ROLE_OWNER %>" <%= ownerChecked %>> <%= _("Owner")%></label>
  125. + <label><input type="radio" id="rmember" name="role" value="<%= UserRole::ROLE_MEMBER %>" <%= memberChecked %>>&nbsp;<%= _("Member")%></label>
  126. + <label><input type="radio" id="rwatcher" name="role" value="<%= UserRole::ROLE_WATCHER %>" <%= watcherChecked %>>&nbsp;<%= _("Watcher")%></label>
  127. +
  128.  
  129. </fieldset>
  130.  
  131. diff --git a/app/views/spaces/admin/index.rhtml b/app/views/spaces/admin/index.rhtml
  132. index 929c4c7..5f4ae8c 100644
  133. --- a/app/views/spaces/admin/index.rhtml
  134. +++ b/app/views/spaces/admin/index.rhtml
  135. @@ -3,203 +3,209 @@
  136. <%= stylesheet_link_tag 'admin_upgrade' %>
  137. <div id="space_settings"></div>
  138. <% if is_site_admin? %>
  139. - <div style="text-align:right">
  140. - <%= link_to _("Admin Setting"), :action=>"admin" %>
  141. - </div>
  142. + <div style="text-align:right">
  143. + <%= link_to _("Admin Setting"), :action=>"admin" %>
  144. + </div>
  145. <% end %>
  146.  
  147. <% if !@space.is_commercial? && @space.is_private? %>
  148.  
  149. -<div class="summary-wrap-red">
  150. -
  151. -<div class="summary_section">
  152. - <div class="ico">
  153. - <a href="<%=url_for :action=>"security"%>" title="<%= _("Upgrade: More Details")%>">
  154. - <%= image_tag("admin/ico_admin-upgrade.gif",:border=>0) %>
  155. - </a>
  156. - </div>
  157. - <div class="more_link">
  158. - <%= link_to _("More"), :action=>"upgrade" %><span>></span>
  159. - </div>
  160. - <div class="summary_body main-features bg_red">
  161. + <div class="summary-wrap-red">
  162. +
  163. + <div class="summary_section">
  164. + <div class="ico">
  165. + <a href="<%=url_for :action=>"security"%>" title="<%= _("Upgrade: More Details")%>">
  166. + <%= image_tag("admin/ico_admin-upgrade.gif",:border=>0) %>
  167. + </a>
  168. + </div>
  169. + <div class="more_link">
  170. + <%= link_to _("More"), :action=>"upgrade" %><span>></span>
  171. + </div>
  172. + <div class="summary_body main-features bg_red">
  173. <h1><a href="<%=url_for :action => "upgrade"%>" title="<%= _("Uprade: More Details")%>"><%= _('Upgrade')%></a></h1>
  174. - <p>
  175. - <%= _("You are an owner of this space, which is private and free.") %>.
  176. - <strong> Assembla is no longer supporting this configuration</strong> so you need to purchase an inexpensive paid subscription, or change your permissions to make this space publicly visible.
  177. - If you do not respond, we will set your space to read-only status, and you will be able to get your private information later. Thank you for selecting one of the options below.
  178. - </p>
  179. - <p>
  180. - <div class="mf-button">
  181. - <div id="mfbutton">
  182. - <div id="mfbtn-inner" style="white-space:nowrap">
  183. - <%= link_to("<em>" + image_tag("/images/upgrade-arrow-small.gif", :alt => _("Upgrade")) + _("Pay for this space and upgrade")+"</em>", make_private_space_path(@space), :method => :put) %>
  184. - </div>
  185. - </div>
  186. - </div>
  187. - <div class="mf-or-cancel"> <%=_("or") %> <%= link_to _("Make this space public"), make_public_space_path(@space), :method => :put%></div>
  188. - </p>
  189. - </div>
  190. + <p>
  191. + <%= _("You are an owner of this space, which is private and free.") %>.
  192. + <strong> Assembla is no longer supporting this configuration</strong> so you need to purchase an inexpensive paid subscription, or change your permissions to make this space publicly visible.
  193. + If you do not respond, we will set your space to read-only status, and you will be able to get your private information later. Thank you for selecting one of the options below.
  194. + </p>
  195. + <p>
  196. + <div class="mf-button">
  197. + <div id="mfbutton">
  198. + <div id="mfbtn-inner" style="white-space:nowrap">
  199. + <%= link_to("<em>" + image_tag("/images/upgrade-arrow-small.gif", :alt => _("Upgrade")) + _("Pay for this space and upgrade")+"</em>", make_private_space_path(@space), :method => :put) %>
  200. + </div>
  201. + </div>
  202. + </div>
  203. + <div class="mf-or-cancel"> <%=_("or") %> <%= link_to _("Make this space public"), make_public_space_path(@space), :method => :put%></div>
  204. + </p>
  205. + </div>
  206.  
  207. -</div>
  208. + </div>
  209.  
  210. -<div class="cut"></div>
  211. + <div class="cut"></div>
  212.  
  213. -</div>
  214. + </div>
  215.  
  216. <%end%>
  217.  
  218. <div class="summary-wrap">
  219. -<div class="summary_section">
  220. - <div class="ico">
  221. - <a href="<%=url_for :action=>"tools"%>" title="<%= _("Tools: More Details")%>">
  222. - <%= image_tag("admin/ico_admin-tools.gif",:border=>0) %>
  223. - </a>
  224. - </div>
  225. - <div class="more_link">
  226. - <%= link_to _("More"), :action=>"tools" %><span>></span>
  227. - </div>
  228. - <div class="summary_body">
  229. - <h1><a href="<%=url_for :action=>"tools"%>" title="<%= _("Tools: More Details")%>"><%= _("Tools")%></a></h1>
  230. - <p><%= _("Configure or Install new")%> <strong><%= _("On-Demand Tools")%></strong></p>
  231. - <p style="margin-top:5px">
  232. - <strong><%= _("Installed Tools")%>:</strong>
  233. + <div class="summary_section">
  234. + <div class="ico">
  235. + <a href="<%=url_for :action=>"tools"%>" title="<%= _("Tools: More Details")%>">
  236. + <%= image_tag("admin/ico_admin-tools.gif",:border=>0) %>
  237. + </a>
  238. + </div>
  239. + <div class="more_link">
  240. + <%= link_to _("More"), :action=>"tools" %><span>></span>
  241. + </div>
  242. + <div class="summary_body">
  243. + <h1><a href="<%=url_for :action=>"tools"%>" title="<%= _("Tools: More Details")%>"><%= _("Tools")%></a></h1>
  244. + <p><%= _("Configure or Install new")%> <strong><%= _("On-Demand Tools")%></strong></p>
  245. + <p style="margin-top:5px">
  246. + <strong><%= _("Installed Tools")%>:</strong>
  247. <%if @installed_tools.empty? %>
  248. - <em><%= _("You don't have any tools yet")%></em>
  249. - </p>
  250. - <%else%>
  251. - </p>
  252. - <ul id="tool_list">
  253. - <% @installed_tools.each do |t| %>
  254. - <li><%= tool_full_title(t) %></li>
  255. - <% end %>
  256. - </ul>
  257. - <%end%>
  258. - </div>
  259. -
  260. -</div>
  261. -
  262. -<div class="cut"></div>
  263. + <em><%= _("You don't have any tools yet")%></em>
  264. + </p>
  265. + <%else%>
  266. + </p>
  267. + <ul id="tool_list">
  268. + <% @installed_tools.each do |t| %>
  269. + <li><%= tool_full_title(t) %></li>
  270. + <% end %>
  271. + </ul>
  272. + <%end%>
  273. + </div>
  274. +
  275. + </div>
  276. +
  277. + <div class="cut"></div>
  278.  
  279. </div>
  280.  
  281. <div class="summary-wrap">
  282. -<div class="summary_section">
  283. - <div class="ico">
  284. - <a href="<%=url_for :action=>"security"%>" title="<%= _("Security: More Details")%>">
  285. - <%= image_tag("admin/ico_admin-access.gif",:border=>0) %>
  286. - </a>
  287. - </div>
  288. - <div class="more_link">
  289. - <%= link_to _("More"), :action=>"security" %><span>></span>
  290. - </div>
  291. - <div class="summary_body">
  292. -
  293. - <% form_tag space_path(@edit), :method=>:put do%>
  294. -<h1><a href="<%=url_for :action=>"security"%>" title="<%= _("Security: More Details")%>">
  295. - <%= _("Security")%>
  296. - </a></h1>
  297. -
  298. - <p>
  299. - <strong><%= _("Non-member access")%>:</strong>
  300. - <label class="inline"><%= _("Allow")%> <%= select 'space', 'public_permissions', @space.public_permission_selector(true), {}, {:style=>"width:75px",
  301. - :onchange=> "javascript:"+remote_function(:url => space_path(@space), :method=>:put,
  302. - :with => 'Form.Element.serialize(this)')} %> <%= _("for public access")%>.</label>
  303. - </p>
  304. - <p>
  305. - <strong><%= _("Member access")%>:</strong>
  306. - <label class="inline"><%= _("Allow")%> <%= select 'space', 'team_permissions', Space::PERMISSION_SELECTOR_TEAM, {}, {:style=>"width:75px",
  307. - :onchange=> "javascript:"+remote_function(:url => space_path(@space), :method=>:put,
  308. - :with => 'Form.Element.serialize(this)')} %> <%= _("for team member access")%>.</label>
  309. - </p>
  310. - <%if !@space.is_commercial? %>
  311. - <p style="font-size:smaller">
  312. - <%= _("You can't set the")%> <strong> <%= _("Non-member access")%></strong> <%= _("to")%> <strong> <%= _("None")%> </strong> <%= _("because your space is not Commercial")%>.
  313. - <%= _("If you want to have a private space you will need to")%> <%= link_to _("upgrade"), :action=>"upgrade"%>.
  314. - </p>
  315. - <%end%>
  316. - <%end%>
  317. - </div>
  318. + <div class="summary_section">
  319. + <div class="ico">
  320. + <a href="<%=url_for :action=>"security"%>" title="<%= _("Security: More Details")%>">
  321. + <%= image_tag("admin/ico_admin-access.gif",:border=>0) %>
  322. + </a>
  323. + </div>
  324. + <div class="more_link">
  325. + <%= link_to _("More"), :action=>"security" %><span>></span>
  326. + </div>
  327. + <div class="summary_body">
  328. +
  329. + <% form_tag space_path(@edit), :method=>:put do%>
  330. + <h1><a href="<%=url_for :action=>"security"%>" title="<%= _("Security: More Details")%>">
  331. + <%= _("Security")%>
  332. + </a></h1>
  333. +
  334. + <p>
  335. + <strong><%= _("Non-member access")%>:</strong>
  336. + <label class="inline"><%= _("Allow")%> <%= select 'space', 'public_permissions', @space.public_permission_selector(true), {}, {:style=>"width:75px",
  337. + :onchange=> "javascript:"+remote_function(:url => space_path(@space), :method=>:put,
  338. + :with => 'Form.Element.serialize(this)')} %> <%= _("for public access")%>.</label>
  339. + </p>
  340. + <p>
  341. + <strong><%= _("Watcher access:")%>:</strong>
  342. + <label class="inline"><%= _("Allow")%> <%= select 'space', 'watcher_permission_level', Space::PERMISSION_SELECTOR_WATCHER, {}, {:style=>"width:75px",
  343. + :onchange=> "javascript:"+remote_function(:url => space_path(@space), :method=>:put,
  344. + :with => 'Form.Element.serialize(this)')} %> <%= _("for watcher access")%>.</label>
  345. + </p>
  346. + <p>
  347. + <strong><%= _("Team Member access")%>:</strong>
  348. + <label class="inline"><%= _("Allow")%> <%= select 'space', 'team_permissions', Space::PERMISSION_SELECTOR_TEAM, {}, {:style=>"width:75px",
  349. + :onchange=> "javascript:"+remote_function(:url => space_path(@space), :method=>:put,
  350. + :with => 'Form.Element.serialize(this)')} %> <%= _("for team member access")%>.</label>
  351. + </p>
  352. + <%if !@space.is_commercial? %>
  353. + <p style="font-size:smaller">
  354. + <%= _("You can't set the")%> <strong> <%= _("Non-member access")%></strong> <%= _("to")%> <strong> <%= _("None")%> </strong> <%= _("because your space is not Commercial")%>.
  355. + <%= _("If you want to have a private space you will need to")%> <%= link_to _("upgrade"), :action=>"upgrade"%>.
  356. + </p>
  357. + <%end%>
  358. + <%end%>
  359. + </div>
  360.  
  361. -</div>
  362. + </div>
  363.  
  364. -<div class="cut"></div>
  365. + <div class="cut"></div>
  366.  
  367. </div>
  368. <div class="summary-wrap">
  369. -<div class="summary_section">
  370. - <div class="ico">
  371. - <a href="<%=url_for :action=>"resources"%>" title="<%= _("Resources: More Details")%>">
  372. - <%= image_tag("admin/ico_admin-resources.gif",:border=>0) %>
  373. - </a>
  374. - </div>
  375. - <div class="more_link">
  376. - <%= link_to _("More"), :action=>"resources" %><span>></span>
  377. - </div>
  378. - <div class="summary_body">
  379. - <h1><a href="<%=url_for :action=>"resources"%>" title="<%= _("Resources: More Details")%>"><%= _("Resources")%></a></h1>
  380. -
  381. - <%if @space.is_commercial? %>
  382. - <% if @space.payer %>
  383. - <p><strong><%= _("Payer")%>:</strong> <%= @space.payer.permissioned_name(logged_user) %></p>
  384. - <%end%>
  385. - <p>
  386. - <strong><%= _("Disk Space Usage")%>:</strong> <%=number_to_human_size(@total)%>
  387. - <span style="margin-left:50px"><strong>Team Size:</strong> <%= pluralize(@space.user_roles.count,"member","members")%></span>
  388. - </p>
  389. - <p><b><%= _("To get support")%></b>, <%= _("email")%> <a href='mailto:<%= UserSystem::CONFIG[:service_support_email] %>'><%= UserSystem::CONFIG[:service_support_email] %></a> <%= _("or call")%> <%= UserSystem::CONFIG[:service_support_phone] %></p>
  390. - <%else%>
  391. -
  392. - <% unless @no_billing %>
  393. - <p><strong><%= link_to _("Upgrade"), :action=>"upgrade"%></strong> <%= _("this space and get all the benefits of a")%> <strong> <%= _("Commercial")%> </strong> <%= _("space")%>: <%= _("Private Space, 5GB of disk space, Automatic external S3 Backup and")%> <%= link_to _("more") %>.</p>
  394. - <% end %>
  395. - <p> <strong><%= _("Disk Space Usage")%>:</strong> <%=number_to_human_size(@total)%> of <%= quota_limit_color @total, @space.max_disk_quota %> </p>
  396. - <%end%>
  397. - </div>
  398. + <div class="summary_section">
  399. + <div class="ico">
  400. + <a href="<%=url_for :action=>"resources"%>" title="<%= _("Resources: More Details")%>">
  401. + <%= image_tag("admin/ico_admin-resources.gif",:border=>0) %>
  402. + </a>
  403. + </div>
  404. + <div class="more_link">
  405. + <%= link_to _("More"), :action=>"resources" %><span>></span>
  406. + </div>
  407. + <div class="summary_body">
  408. + <h1><a href="<%=url_for :action=>"resources"%>" title="<%= _("Resources: More Details")%>"><%= _("Resources")%></a></h1>
  409. +
  410. + <%if @space.is_commercial? %>
  411. + <% if @space.payer %>
  412. + <p><strong><%= _("Payer")%>:</strong> <%= @space.payer.permissioned_name(logged_user) %></p>
  413. + <%end%>
  414. + <p>
  415. + <strong><%= _("Disk Space Usage")%>:</strong> <%=number_to_human_size(@total)%>
  416. + <span style="margin-left:50px"><strong>Team Size:</strong> <%= pluralize(@space.user_roles.count,"member","members")%></span>
  417. + </p>
  418. + <p><b><%= _("To get support")%></b>, <%= _("email")%> <a href='mailto:<%= UserSystem::CONFIG[:service_support_email] %>'><%= UserSystem::CONFIG[:service_support_email] %></a> <%= _("or call")%> <%= UserSystem::CONFIG[:service_support_phone] %></p>
  419. + <%else%>
  420.  
  421. + <% unless @no_billing %>
  422. + <p><strong><%= link_to _("Upgrade"), :action=>"upgrade"%></strong> <%= _("this space and get all the benefits of a")%> <strong> <%= _("Commercial")%> </strong> <%= _("space")%>: <%= _("Private Space, 5GB of disk space, Automatic external S3 Backup and")%> <%= link_to _("more") %>.</p>
  423. + <% end %>
  424. + <p> <strong><%= _("Disk Space Usage")%>:</strong> <%=number_to_human_size(@total)%> of <%= quota_limit_color @total, @space.max_disk_quota %> </p>
  425. + <%end%>
  426. + </div>
  427.  
  428. -</div>
  429.  
  430. -<div class="cut"></div>
  431. + </div>
  432. +
  433. + <div class="cut"></div>
  434.  
  435. </div>
  436.  
  437.  
  438. <div class="summary-wrap">
  439. -<div class="summary_section">
  440. - <div class="ico">
  441. - <a href="<%=url_for :action=>"general"%>" title="<%= _("General: More Details")%>">
  442. - <%= image_tag("admin/ico_admin-configure.gif",:border=>0) %>
  443. - </a>
  444. - </div>
  445. - <div class="more_link">
  446. - <%= link_to _("More"), :action=>"general" %><span>></span>
  447. - </div>
  448. - <div class="summary_body">
  449. - <h1><a href="<%=url_for :action=>"general"%>" title="<%= _("General: More Details")%>">General</a></h1>
  450. - <p><%= _("Change your space name, url or description")%>. <%= _("Configure the appearence of your site with your own stylesheet or with your company's banner") %>.</p>
  451. - </div>
  452. -
  453. -</div>
  454. -
  455. -<div class="cut"></div>
  456. + <div class="summary_section">
  457. + <div class="ico">
  458. + <a href="<%=url_for :action=>"general"%>" title="<%= _("General: More Details")%>">
  459. + <%= image_tag("admin/ico_admin-configure.gif",:border=>0) %>
  460. + </a>
  461. + </div>
  462. + <div class="more_link">
  463. + <%= link_to _("More"), :action=>"general" %><span>></span>
  464. + </div>
  465. + <div class="summary_body">
  466. + <h1><a href="<%=url_for :action=>"general"%>" title="<%= _("General: More Details")%>">General</a></h1>
  467. + <p><%= _("Change your space name, url or description")%>. <%= _("Configure the appearence of your site with your own stylesheet or with your company's banner") %>.</p>
  468. + </div>
  469. +
  470. + </div>
  471. +
  472. + <div class="cut"></div>
  473.  
  474. </div>
  475. <br />
  476. <div id="delete_page">
  477. - <div id="buttonm">
  478. - <div id="btn-inner">
  479. - <%= link_to content_tag('em', image_tag("remove.gif") + _('Delete this space')), space_path(@space.id), :method => :delete,
  480. + <div id="buttonm">
  481. + <div id="btn-inner">
  482. + <%= link_to content_tag('em', image_tag("remove.gif") + _('Delete this space')), space_path(@space.id), :method => :delete,
  483. :confirm =>_("Are you sure you want to delete this Space?") %>
  484. - </div>
  485. - </div>
  486. + </div>
  487. + </div>
  488.  
  489.  
  490. - </div>
  491. +</div>
  492.  
  493. - <span class="warning">
  494. - <strong><%= _("Warning")%>:</strong> <%= _("All your space and tools data will be lost if you remove your space")%>.
  495. +<span class="warning">
  496. + <strong><%= _("Warning")%>:</strong> <%= _("All your space and tools data will be lost if you remove your space")%>.
  497.  
  498. - </span>
  499. +</span>
  500.  
  501.  
  502.  
  503. @@ -207,6 +213,6 @@
  504.  
  505. <!--
  506. <%=link_to(_("Delete this space")+"...", space_path(@space.id),
  507. - :method => :delete, :class => 'button',
  508. - :confirm =>_("Are you sure you want to delete this Space?")) %>&nbsp;&nbsp;&nbsp;<small><strong>Warning:</strong> All your space and tools data will be lost if you remove your space.</small>
  509. - -->
  510. + :method => :delete, :class => 'button',
  511. + :confirm =>_("Are you sure you want to delete this Space?")) %>&nbsp;&nbsp;&nbsp;<small><strong>Warning:</strong> All your space and tools data will be lost if you remove your space.</small>
  512. +-->
  513. diff --git a/app/views/spaces/admin/security.rhtml b/app/views/spaces/admin/security.rhtml
  514. index d8ff070..2b89138 100644
  515. --- a/app/views/spaces/admin/security.rhtml
  516. +++ b/app/views/spaces/admin/security.rhtml
  517. @@ -1,3 +1,4 @@
  518. +
  519. <div class="new-form">
  520. <div class="security-page">
  521. <% space_page_title _("Security") %>
  522. @@ -24,12 +25,19 @@
  523. </fieldset>
  524.  
  525. <fieldset>
  526. - <h5><%= _("Member access")%></h5>
  527. + <h5><%= _("Team Member access")%></h5>
  528. <label><%= _("Allow")%> <%= select 'space', 'team_permissions', Space::PERMISSION_SELECTOR_TEAM, {}, {:style=>"width:75px"} %> <%= _("for team member access")%>.</label>
  529. <p class="tip"><%= _("Choose how members of your team will be able to access your space")%>.</p>
  530. </fieldset>
  531.  
  532. <fieldset>
  533. + <h5><%= _("Watcher access")%></h5>
  534. + <label><%= _("Allow")%> <%= select 'space', 'watcher_permission_level', Space::PERMISSION_SELECTOR_WATCHER, {}, {:style=>"width:75px"} %> <%= _("for team member access")%>.</label>
  535. + <p class="tip"><%= _("Watchers can be customers or other observers")%>.</p>
  536. + </fieldset>
  537. +
  538. +
  539. + <fieldset>
  540. <legend><%= _("Allowed IP addresses to connect to space tools")%>.</legend>
  541. <%= text_area('space', 'allowed_ips', :rows => 4, :cols => 40)%>
  542. <p class="tip"><%= _("Enter one IP per line. (Commercial spaces only)")%></p>
  543. diff --git a/db/migrate/352_add_watcher_permission_level_to_spaces.rb b/db/migrate/352_add_watcher_permission_level_to_spaces.rb
  544. new file mode 100644
  545. index 0000000..76565f5
  546. --- /dev/null
  547. +++ b/db/migrate/352_add_watcher_permission_level_to_spaces.rb
  548. @@ -0,0 +1,9 @@
  549. +class AddWatcherPermissionLevelToSpaces < ActiveRecord::Migration
  550. + def self.up
  551. + add_column :spaces, :watcher_permission_level, :integer, :default => Space::PERMISSION_VIEW
  552. + end
  553. +
  554. + def self.down
  555. + remove_column :spaces, :watcher_permission_level
  556. + end
  557. +end
Add Comment
Please, Sign In to add comment