Skip to content
  • tjhunt's avatar
    block contexts: MDL-19098 every block should have a context · e92c286c
    tjhunt authored
    even non-course and sticky blocks.
    
    The parent context is block_instances.parentcontextid.
    
    The block context should be used for checking permissions directly
    related to the block, like moodle/block:view or moodle/site:manageblocks.
    
    However, if the block is displaying information about the current page,
    for example the participants block showing who 'here', then it may be
    better to use the context of the page where the bloack is appearing -
    in other words $this->page->context - to check permissions about the
    user's ability to see participants here.
    
    Or, if the block is displaying something stronly related to courses,
    for example, a course meny block, the block should probably use the
    context for $this->page->course to check permissions.
    e92c286c