Commit Graph

438 Commits

Author SHA1 Message Date
Lephe 6f98cba65e
review of privileges and forum permissions
* Sorted privileges into categories, similar to the v4.3 style

Added privilege check utilities:
* Forum: is_news(), is_default_accessible() and is_default_postable()
* Member: can_access_forum(), can_post_in_forum(), can_edit_post(),
  and can_delete_post()

Unfortunately current_user is not a Guest when logged out, so one
cannot usually write current_user.can_*() without checking for
authentication first, so the checks are still somewhat verbose.

Reviewed forum permissions; the following permission issues have been
fixed (I have tested most but not all of them prior to fixing):

* app/routes/forum/index.py: Users that were not meant to access a
  forum could still obtain a listing of the topics
* app/routes/forum/topic.py: Users that were not meant to see topics
  could still read them by browsing the URL
* app/routes/forum/topic.py: Authenticated users could post in any
  topic, including ones that they should not have access to
* app/routes/posts/edit.py: Users with edit.posts (eg. mods) could edit
  and delete messages in forums they can't access (eg. creativecalc)

* app/templates/account/user.html: Users with admin panel access would
  see account editing links they can't use (affects developers)
* app/templates/base/navbar/forum.html: The "Forum" tab would list all
  forums including ones the user doesn't have access to
* app/templates/forum/index.html: Users would see every single forum,
  including ones they can't access
* app/template/widgets/thread.html: Anyone would see Edit/Delete links
  on every message, even though most were unusable

Miscellaneous changes:
* app/routes/forum/topic.py: Ordered comments by date as intended,
  which I assume worked by chance until now
* Removed the old assets/privs.txt files which is now superseded by the
  list implemented in app/data/groups.yaml

This commit changes group and forum information, run master.py with:
@> forums update
@> groups update
2021-02-26 18:32:45 +01:00
Lephe d50b58cd24
(random improvements on texts) 2021-02-26 18:31:10 +01:00
Lephe 3ee3794818
master: fix groups not fully updating
Fixes c8661ca50.
2021-02-26 18:31:10 +01:00
Darks 0edc996287
markdown: add linkify extension 2021-02-24 00:38:26 +01:00
Darks 41d1411f86
markdown: add hard breaks with \\
Plus some PEP8 enhancements
2021-02-24 00:06:49 +01:00
Darks f722d700c2
markdown: add some tags to bleach allowlist 2021-02-23 23:25:20 +01:00
Darks 53afccf2a3
markdown: fixed allowlists 2021-02-23 13:49:14 +01:00
Darks 6136c6e9bf
markdown: add better sanitization
And disable nl2br extension
2021-02-23 13:30:09 +01:00
Darks eba1b7dd3b
markdown: better input sanitization 2021-02-23 12:00:34 +01:00
Eldeberen 7e7e865430
Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into dev 2021-02-22 23:54:51 +01:00
Eldeberen fecbdffee8
polls: add link in admin panel 2021-02-22 23:54:47 +01:00
Eldeberen 938516cb3f
polls: added admin panel and deletion form 2021-02-22 23:50:19 +01:00
Eldeberen d6512bb197
polls: added multi-choices polls 2021-02-22 22:49:11 +01:00
Eldeberen b23fc15b6e
polls: changes in template, display results when user has voted 2021-02-21 21:15:54 +01:00
Eldeberen 5958605d2b
forum: fix message for necropost warning 2021-02-21 20:29:55 +01:00
Eldeberen f10d5404c2
forum: fix #84 2021-02-21 20:17:48 +01:00
Eragon f3bb8858f0
Vérification de l'existence d'une signature pour l'afficher 2021-02-21 12:17:55 +01:00
Eldeberen 0c7474d8ba
pclink: add handle for topics
rewrite some handles in french
2021-02-21 12:02:12 +01:00
Eldeberen cd8ce4f5bc
admin: fix name edition through admin panel (#85) 2021-02-20 19:32:18 +01:00
Eldeberen 894a0b6549
pclink: fix link for users 2021-02-20 19:09:30 +01:00
Lephe 1d457d7e65
topic: fix model preventing Post from polymorphic loading as Topic 2021-02-20 19:03:14 +01:00
Eldeberen d0714d87b0
poll: phoque it. XML is much more restrictive than html 2021-02-20 18:43:37 +01:00
Eldeberen e2c84df6e3
poll: fixed a ***** bug 2021-02-20 18:31:40 +01:00
Eldeberen 5efcadb23e
Merge branch 'polls' into dev 2021-02-20 17:52:59 +01:00
Eldeberen b5630e0079
md: add pclink for users 2021-02-20 17:36:36 +01:00
Lephe c8661ca50f
master: update groups without deleting them 2021-02-20 17:34:56 +01:00
Eldeberen 9d08f81342
poll,md: adds pclink for polls 2021-02-20 17:17:33 +01:00
Darks b08085d54e Merge branch 'dev' into polls 2021-02-20 15:48:30 +01:00
Eldeberen 85dfde3811
md: improved markdown 2021-02-20 15:39:52 +01:00
Eldeberen cd8efcced8
Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into polls 2021-02-20 01:36:04 +01:00
Eldeberen fabad32955
polls: add a panel to manage own polls 2021-02-20 01:28:08 +01:00
Eldeberen 0801b8ec16
poll: add poll creation form 2021-02-20 00:39:22 +01:00
Eldeberen 473448ab5b
poll: add ability to vote
Fixed some bugs too
2021-02-20 00:33:34 +01:00
Eldeberen ec3f33ead0
polls: updated templates 2021-02-19 23:26:10 +01:00
Eldeberen 3b1aa2fc1d
admin-panel: fix users registration date 2021-02-19 22:23:26 +01:00
Eldeberen 169aca8304
polls: added migration 2021-02-19 22:07:43 +01:00
Eldeberen d2c5ddd874
polls: added models 2021-02-19 22:07:31 +01:00
Eldeberen c0bb2f5448
misc: small fixes 2021-02-18 00:04:28 +01:00
Eragon 9273430f9a
#84 Configuration de la durée avant nécropost 2021-01-12 17:34:50 +01:00
Eragon 4ddf60353c
#84 Passage du dernier post en cas de nécropost 2021-01-12 17:30:54 +01:00
Eragon c0ae3cc8ab
#84 Confirmation anti-nécropost 2021-01-12 16:40:52 +01:00
Darks 243ae43783
dev: added support for local development test files 2020-11-13 01:45:55 +01:00
Darks 4aa1802afb
polls: created backbone of models (#72) 2020-11-12 00:11:33 +01:00
Darks 63baae9683
Merge branch 'glados' of gitea.planet-casio.com:devs/PCv5 into dev 2020-11-11 13:47:24 +01:00
Darks 98de289ea1
glados: added glados socket and example wrapper 2020-11-11 13:28:53 +01:00
Lephe 1d38f906ee
admin/members: add a dynamic regex/logic filter for the member list
This commit introduces a client-side table filter that supports regexes
and propositional logic to filter table rows.

A table can be filtered if it has the [filter-target] class and its
first row has <th> tags with a [data-filter] attribute specifying column
names.

The filter itself is a div with the [form] and [filter] classes, and a
[data-target] attribute pointing to the table to filter. The filter
contains a text <input> which is passed to filter_update() when the
filter expression is validated.

The client-side filter code runs the expression through a basic lexer
and parser, then matches the result for every row in the target table.
The [textContent] of each cell is used for string and regex matching.
2020-11-02 14:38:28 +01:00
Lephe 13b2bd2671
admin/members: add a full member list
... which can someday be filtered for names, shared IPs, registration
dates, and other useful tools.
2020-11-01 16:12:15 +01:00
Lephe 0be0d5ab65
admin/groups: show only users with groups or special privileges 2020-11-01 15:59:38 +01:00
Lephe 8155cf1550
threads: fix misplaced </td> in template 2020-11-01 15:59:25 +01:00
Lephe 75f3a90f20
master.py: update forums with stateful logic
The create-forums function has been replaced with an [update] subcommand
of [forums]. This new function tries its best to keep existing forum
objects, which is especially important once content has been created.

Forums are identified by their URL. Changing the URL means the forum
needs to be recreated. If the URL doesn't changed, metadata is updated
without removing topics and subforums in that forum.

* Improve the update model for forums in master.py
* Fix a typo in the prefix for the tool projects subforum
* Add the admin and assoc boards for permission testing
2020-11-01 10:50:52 +01:00