32 Commits

Author SHA1 Message Date
Jens Ulferts 033faf78dc Fix/add visibibility scope to capabilities (#21993)
* introduce visible scope to capabilities and apply it to CapabilityQuery

* remove redundant scope

Capability has the `.default` scope as its default scope

* adding spec on show action for unreadable capability

* reuse existing shared example

* move Principal.visible check into Capability.visible
2026-02-16 09:29:49 +01:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Alexander Brandon Coles 1d707895c6 Grammar fixes in code, docs: possessive its/it's
- **it's** is a contraction of _it is_ or _it has_. It requires an
apostrophe.
- **its** is the posssive form of _it_, denoting ownership. It should
not use an apostrophe.
2025-02-12 06:36:46 -03:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
ulferts 61a38adcf5 exclude entity memberships from non member capability calculation 2023-09-06 11:31:30 +02:00
ulferts ca935e3f0f fix capabilities by non member role if user has another role
No longer will the non member role`s capabilities be signaled to be had by users having at least one role in the project. This is in sync with how the actual permission checks handle the permissions.
2023-09-06 11:31:27 +02:00
Klaus Zanders 62e1829839 Remove entity specific items from Capabilities query 2023-09-05 13:04:42 +02:00
Klaus Zanders aacaf82fd1 Filter out duplicates if the same actions are allowed by different permissions 2023-07-20 08:59:18 +02:00
Klaus Zanders 2296215927 Fix specs after splitting permissions 2023-07-20 08:59:14 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard 6d5f9e36fc Add 'Project details activity' menu entry
Added to the Project details widget on project overview page.

Displaying the menu entry conditionally depending on the activity module
being activated is done through a public permission. Capabilities
endpoint has been extended to include actions from public permissions.
2023-01-23 09:31:21 +01:00
Christophe Bliard 3cd78260c0 refactor: Make spec example names more descriptive 2023-01-23 09:29:39 +01:00
Christophe Bliard f9fb280045 refactor: Make test faster
5.3 secs => 2.1 secs
2023-01-23 09:29:38 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
ulferts c7d37bd391 add spec to ensure users don't receive anonymous role's permissions 2022-11-22 17:37:13 +01:00
ulferts bba8376af9 add spec on anonymous user capability 2022-11-21 09:42:21 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
ulferts a775e9e5d8 introduce permission governing whether work packages can be assigned 2022-03-03 11:36:58 +01:00
ulferts f8075eaf9e cleanup and linting 2022-03-03 11:35:09 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Wieland Lindenthal 33443c154e Update IFC Viewer with latest Xeokit updates (#9207)
* Bump @xeokit/xeokit-gltf-to-xkt to version 1.0.0

* Bump Xeokit SDK and Xeokit BIM Viewer

* Overwrite XEOKIT orthogonal/perspective toggle icon

* Add styles for section tool and its menu

* Remove SAO deactivation for non default models.

Performance of SAO has improved ever since Xeokit's FastNavPlugin was created.

* bump xeokit sdk and bim viewer

* IFC viewer toolbar adoption for section plane tool.

* Fix spec after xeokit bump

* Feature 33880 Add Edit/Delete/Add model buttons in Models tab

* Paths to xeokit's bim viewer code changed

* Bumping xeokit packages

* Fix default_spec.rb for scopes
2021-05-05 15:29:17 +02:00
ulferts 0bec3cb8c2 fix namespace of actions (#9195)
The actions are now more rubyish again which will reflect in the urls where we also have an underscore based pattern
2021-04-28 08:31:44 +02:00
ulferts 4bf7a26eb1 Capabilities API (#9083)
* Capabilities API

* introduce auxilliary capability model

* capability model and query

* render in sql

* fix pagination

* introduce sql representer

* extract abstract sql representer class

* remove yet unused methods

* abstract sql collection representer

* contract_actions as part of permissions

* filter for capability id - used in GET

* id filter validation

* remove unused representer

* remove unused wp representer

* reuse renaming class

* add spec for access control

* add principal filter to capability

* add context filter

* extract capability sql into scope

* admin gets all capabilities

* require to have one filter set to keep performance bearable

* consider active project modules for capabilities

* limit capability based on principal visiblity and user state

* rework capability to be tableless

* spec not being allowed to see on request level

* add actions to capability representer

* add action api

* extract sql index endpoint

* remove unused class

* prepare sending signaling error - not yet frontend exposed

* extract show endpoint for sql rendered responses

* use UNION for better performance

* include navigation links on collections

* remove string replacements

* extract collection representer into hal sql module

* no capabilities when blocked

* remove commented out code
2021-03-23 21:45:38 +01:00