Commit Graph

38 Commits

Author SHA1 Message Date
Javi Martín
4c8dfb6695 Use just one action to hide users
Other than removing a redundant action, we're fixing two bugs when
blocking an author using the links in the public views:

* We were always redirecting to the debates index, even if we blocked
  the author of a proposal or an investment
* We weren't showing any kind of success message
2021-12-30 15:50:02 +01:00
taitus
fb5965fe63 Add cancancan to SDG content
Only allow access to the SDG content section to administrators and sdg managers
2020-12-16 11:43:17 +01:00
Javi Martín
ac6d50e06b Remove tracker role
The current tracking section had a few issues:

* When browsing as an admin, this section becomes useless since no
investments are shown
* Browsing investments in the admin section, you're suddenly redirected
to the tracking section, making navigation confusing
* One test related to the officing dashboard failed due to these changes
and had been commented
* Several views and controller methods were copied from other sections,
leading to duplication and making the code harder to maintain
* Tracking routes were defined for proposals and legislation processes,
but in the tracking section only investments were shown
* Probably many more things, since these issues were detected after only
an hour reviewing and testing the code

So we're removing this untested section before releasing version 1.1. We
might add it back afterwards.
2019-11-01 20:08:46 +01:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
53670602e0 Allow managers to read investment suggestions
When creating a budget investment with an unverified manager (for
example, a manager who isn't part of the local census), there's a
request to `Budgets::InvestmentsController#suggest`. Since the manager
isn't verified, suggestions can't be obtained.

There are serveral ways to fix this problem:

* Add a `suggest` action to Management::Budgets::InvestmentsController,
doing the same thing the main `suggest` action does.
* Give unverified users permission to access investment suggestions
* Give managers permission to access investment suggestions

I've chosen the last one because I thought it was simple and only
changed existing behaviour for managers, but any other solution would be
as valid. I haven't added the `phase: "accepting"` condition to keep it
simple, since a read-only action like this one in the management portal
isn't gonna create security risks.
2019-09-20 12:51:26 +02:00
German Galia
9ce524e1f3 Create tracker rol 2019-06-12 16:23:40 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Juanjo Bazán
11d6d0b6d6 adds spending proposal show for valuator and admin 2016-02-18 19:00:24 +01:00
kikito
82af488ce3 Splits ability.rb and specs into several smaller files
I'm doing this in preparation for the "Manager" ability, which will
require even more refactors of the abilities (for example,
manager can not modify their own account)
2015-09-28 13:51:42 +02:00
kikito
343025872b changes comment moderation to be similar to proposals moderation 2015-09-22 14:20:37 +02:00
kikito
757205a93e Unifies bulk & debates moderation forms in a single one 2015-09-21 15:41:01 +02:00
kikito
50148f0aaf Adds new abilities for proposals 2015-09-13 22:07:44 +02:00
kikito
22e8d615aa fixes abilities: level 3 users can vote proposals, not just level 2 2015-09-12 14:13:40 +02:00
kikito
68790ac8e5 adds abilities for proposals 2015-09-12 12:48:47 +02:00
rgarcia
3f7338a6ae adds proposal new and create 2015-09-12 11:38:22 +02:00
kikito
6902d2851b Takes already-flagged-content out of Ability's concerns 2015-09-01 10:33:11 +02:00
Jose Manuel
ef1f89ab84 Merge branch 'refactored_moderator' into master 2015-08-29 02:15:26 +01:00
Jose Manuel
e21336aeff Refactored admin´s moderator controller 2015-08-29 01:39:46 +01:00
kikito
1770dfd3f6 adds ability to confirm the hiding of comments, debates or users 2015-08-27 13:20:12 +02:00
kikito
cd982768f2 Renames the "archive" action to "ignore_flag" (+)
* archived_at -> ignored_flag_at
* archived? -> ignored_flag?
* archive -> ignore_flag
* pending -> pending_flag_review
* archived (scope) -> with_ignored_flag
* I18n changes
2015-08-27 11:43:58 +02:00
kikito
909dfb4ce3 Several renamings
InappropiateFlag -> Flag
x.flag_as_inappropiate -> x.flag
x.undo_flag_as_inappropiate -> x.unflag
X.flagged_as_inappropiate -> x.flagged
flag-as-inappropiate-actions views & css -> flag-actions views & css
2015-08-27 10:48:49 +02:00
kikito
6110284356 removes all references to "review" (replaced by "archive") 2015-08-26 13:48:57 +02:00
Juanjo Bazán
3085f265d8 adds abilities for commenting as moderator/admin 2015-08-24 13:17:58 +02:00
kikito
5e32fd2fa4 Adds new abilities for moderators
extends hiding (i.e. you can not hide your own content or yourself) and
adds marking as reviewed
2015-08-21 20:39:40 +02:00
kikito
0fe7740a41 Refactors ability making flagging more efficient 2015-08-21 20:36:04 +02:00
kikito
ee881230ba merges master and fixes conflicts 2015-08-20 18:50:10 +02:00
kikito
246145e4cb adds abilities for regular users 2015-08-20 18:45:32 +02:00
Juanjo Bazán
259aa29de7 adds new abilities 2015-08-20 13:16:37 +02:00
kikito
c3bee45eda fixes error in abilities 2015-08-17 17:59:23 +02:00
kikito
9e1581656a merges master and fixes conflicts 2015-08-17 17:38:34 +02:00
rgarcia
f31ed2940d adds moderation to comments and debates [#136] 2015-08-17 13:39:31 +02:00
kikito
b4b69d89e7 Updates abilities for the new organisations
Note that unverified organisations can now create debates and comments
- that is a change over the initial request
2015-08-13 20:03:38 +02:00
kikito
450b0098c6 Adds abilities for verifying/rejecting organizations 2015-08-12 17:48:25 +02:00
kikito
9ee1e5dbc5 Adds Abilities for Organizations 2015-08-11 19:34:18 +02:00
kikito
84d848df7e Adapts the CommentsController to the new permissions system 2015-08-10 15:40:23 +02:00
kikito
ce27a6f2ea Adapts AccountController to new permissions system 2015-08-10 15:10:47 +02:00
kikito
30e738a2fe Add cancan authorization in all main urls 2015-08-10 14:59:42 +02:00
kikito
8b53ae6f08 Adds Abilities for Debates 2015-08-10 12:38:22 +02:00