Commit Graph

925 Commits

Author SHA1 Message Date
Shamim Rezaie 9708ad500b Merge branch 'MDL-55580_master' of https://github.com/marxjohnson/moodle 2022-10-17 19:19:36 +11:00
Laurent David bcc18e2439 MDL-55580 core: Process for deprecating a capability
* Add a $deprecatedcapabilities variable to deal with deprecated
capabilities

Change-Id: I14f44d331e8a1c4bd9abe9566c78d911c0205583
Co-authored-by: Mark Johnson <mark.johnson@catalyst-eu.net>
2022-10-11 08:48:17 +01:00
Marina Glancy 41b93bd7e5 MDL-73424 general: Internal methods must have same type as parent
Otherwise the error is thrown in PHP8.1
2022-10-10 16:46:13 +02:00
Sujith Haridasan 73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Andrew Nicols 00efa6aecf MDL-74271 context: Improve performance of block context creation 2022-04-06 23:40:15 +08:00
Peter Spicer edde68e078 MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:36:25 +10:00
cescobedo 3c6ad8ac09 MDL-72616 blocks: Remove block_quiz_results 2021-10-27 06:23:04 +02:00
Amaia Anabitarte 1d4edcb57b MDL-72099 core_contenbank: Add context navigation 2021-10-14 13:04:13 +02:00
Brendan Heywood 7b938088b5 MDL-71014 core: Cache immutable bootstrap config locally 2021-09-02 13:22:28 +10:00
Luca Bösch 0fb0743025 MDL-71284 assign: prevent double escaping assignment name. 2021-05-27 20:31:42 +02:00
Luca Bösch 7dd58aac64 MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:30:46 +02:00
sam marshall 5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall 558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Paul Holden 43adc7a333 MDL-70614 user: consistent roles spacing in course profile. 2021-02-01 07:55:04 +00:00
Paul Holden 20905a1481 MDL-70159 tool_capability: order capabilities by their name. 2021-01-14 07:32:56 +00:00
Andrew Nicols 81bb3a65b1 MDL-68974 admin: Prevent login as outside of the desired context 2020-09-08 08:54:26 +02:00
Paul Holden a9165e69b4 MDL-63387 access: add parameter to define how role names are returned. 2020-09-01 12:05:15 +01:00
Mike Churchward 9e8e75a05a MDL-68866 accesslib: Fixing parameter documentation. 2020-05-28 22:01:22 -04:00
Matt Porritt 01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00
Tim Hunt 1ed243c2fe MDL-68402 accesslib: fix coding style of loops 2020-05-06 09:18:02 +01:00
Tim Hunt 1736c59925 MDL-68402 accesslib: Modernise coding style in the functions changed 2020-05-06 09:18:02 +01:00
Tim Hunt 0d3bdb94bc MDL-68402 accesslib: fix get_with_capability_join logic
In fact, rather than fix the old logic, I noticed that the correct
logic was already implemented in get_users_by_capability. So, I
refactored to extract the working version into a function, which it
turns out can have exactly the same API as get_with_capability_join,
which was convenient.
2020-05-06 09:18:02 +01:00
Tim Hunt 45c4d4aa8c MDL-46123 accesslib: improve get_component_string 2019-12-03 23:11:11 +01:00
sam marshall 7ba2a20166 MDL-66326 Global search: Delete from index when courses are deleted
Adds new API support within search engines for optional methods to
delete data for courses and contexts, and implements this for the
two core search plugins (simpledb and solr).

The new API is automatically called when courses or contexts are
deleted. When a whole course is deleted, it only sends the course
delete rather than sending 1,000 separate context deletions as
each activity/block is deleted.
2019-08-23 11:51:50 +01:00
Neill Magill e3ec42093a MDL-65443 core: Log when a context is locked or unlocked 2019-08-20 08:52:35 +01:00
Simey Lameze a98bafa163 MDL-66034 core_role: implement capability unassigned event 2019-08-05 13:09:18 +08:00
Simey Lameze 7b0afca816 MDL-66034 core_role: implement capability assigned event 2019-08-05 13:09:18 +08:00
Andrew Nicols 29c442c558 MDL-65646 core: Move component storage to json 2019-06-13 12:26:00 +08:00
Marina Glancy beff3806d6 MDL-10965 courses: capability to browse course list 2019-04-10 12:35:28 +02:00
Paul Holden 9ded266b4e MDL-43130 access: fix user counting when retrieving assignable roles.
Previously users assigned the same role in a context via multiple
components would be counted multiple times.
2019-03-08 12:32:24 +00:00
Andrew Nicols fe41810304 MDL-64410 access: Check for context locking in cap functions 2019-03-06 12:36:05 +01:00
Andrew Nicols c40f6adbe0 MDL-64971 access: Ensure that the capability exists when fetching 2019-03-06 10:16:06 +08:00
Tim Hunt a44065edaa MDL-61441 accesslib: get_users_by_capability groups perf improvement 2019-01-11 11:26:41 +00:00
Andrew Nicols 889b585b29 MDL-63686 core: recordset => records when fetching contexts 2019-01-09 19:08:08 +08:00
Andrew Nicols ccbdced987 MDL-63686 core: Preload parent contexts 2019-01-08 14:11:00 +08:00
Andrew Nicols bb41db9ce0 MDL-53566 core: Allow admins more control over locking
This change allows sites to configure locking such that it does not
apply to administrators at all.
2018-11-13 21:17:40 +08:00
Andrew Nicols 56db1a2d7c MDL-53566 core: Remove unused ancestorlocked field
This was originalyl intended as a performance improvement, but the
parent is already stored, and once calculated the value of locked is
already returned.
2018-11-13 21:17:40 +08:00
Andrew Nicols 0616f045c3 MDL-53566 core: Add support for context locking
This chagne adds support for a new feature known as Context Locking.
This allows a context to be locked, thereby removing all write
capabilities for all users (including admin) for that context, and all
child contexts.
2018-11-13 21:17:40 +08:00
Andrew Nicols 74a938c353 MDL-63818 core: Add all relevant module context caps
This change ensures that all capabilities at module context level are
shown within a module, only filtering out those which belong to another
module or the subplugins of another module.

This has the effect that module-level capabilities are included
providing they relate to
- the module being queried
- any subplugin of that module
- any capability at module level which does not belong to another module
  or its subplugin
- any other explicitly included capability

This allows permissions to be defined on a capability at a context
level.
2018-11-01 20:51:18 +08:00
David Monllao e8ce6ca306 MDL-54035 accesslib: Check if the user can switch role before switching 2018-09-26 13:03:08 +02:00
Jonathan Champ 1113e34675 MDL-54035 accesslib: Add context->get_parent_context_paths()
Returns full context paths for parent contexts. Useful for exact
matches, such as when checking dirtycontexts.
2018-09-21 09:17:43 -04:00
Jonathan Champ 1d049e08e5 MDL-54035 accesslib: add mark_user_dirty helper
Instead of marking an entire context dirty and affecting all users
of those contexts, mark the user as dirty when the change only
affects that user.
2018-09-21 09:17:43 -04:00
Jonathan Champ 34dd57053d MDL-54035 accesslib: only modify role_capabilities in accesslib
Whenever the role_capabilities table is changed, we need to remember
to clear the cache for the role(s) being modified. This is far simpler
when all of those changes happen in a single file, i.e. accesslib.php,
allowing other parts of the application to use the public functions
without requiring knowledge of the cache internals.
2018-09-21 09:17:43 -04:00
Jonathan Champ b2f349a433 MDL-54035 accesslib: separate role definition cache clear
Thanks to MDL-49398, we can separate the combined user session and role
definition cache clearing function into two separate functions. At the
same time, we want to identify and remove mark_dirty() calls that were
added for role definition changes but were incorrectly left behind.

Change highlights:
 - Remove unnecessary mark_dirty() calls performed after
   assign_capability(), unassign_capability(), delete_role(),
   deleted contexts, brand new contexts
 - Move role definition cache clear from the user-centric
   accesslib_clear_all_caches() to the newly created,
   role-dedicated accesslib_reset_role_cache()
2018-09-21 09:17:42 -04:00
Marina Glancy 442f12f81a MDL-62742 core: rename coursecat->core_course_category
Also rename course_in_list -> core_course_list_element
Deprecate class coursecat_sortable_records
2018-08-28 11:36:23 +02:00
cescobedo df536ab17d MDL-62065 core_access: First deprecation of get roles on exact context 2018-07-29 22:43:06 +02:00
Tim Hunt a1bc8928cc MDL-62747 accesslib: rdef caching should handle roles with no caps 2018-06-19 16:26:00 +01:00
Tim Hunt 5359c517d0 MDL-62440 participants: out-of-memory is many site-wide role assigns 2018-05-17 10:42:31 +01:00
Jun Pataleta 8403325c9e MDL-50666 core: Add sortorder to fields to be queried 2017-12-20 15:43:19 +13:00
Andrew Hancox 64cd459648 MDL-50666 core: Rename allow_ACTION to core_role_set_ACTION_allowed 2017-12-19 13:53:23 +13:00