From 2a4e13c5e71d7181760ce1d00079fa5994d6e98f Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 17 Aug 2007 13:07:23 +0000 Subject: [PATCH] MDL-10894 - Make block add/remove and edit permissions more consistent --- blocks/moodleblock.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 730348b7ba..49d369cd8a 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -361,20 +361,24 @@ class block_base { } $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey)); - // place holder for roles button - $movebuttons .= '' . + // place holder for roles button + $movebuttons .= '' . ''.$this->str->assignroles.''; - $movebuttons .= '' . - ''.$title.''; + if ($this->user_can_edit()) { + $movebuttons .= '' . + ''.$title.''; + } if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) { $movebuttons .= '' . ''. $this->str->configure .''; } - $movebuttons .= '' . - ''. $this->str->delete .''; + if ($this->user_can_addto($page)) { + $movebuttons .= '' . + ''. $this->str->delete .''; + } if ($options & BLOCK_MOVE_LEFT) { $movebuttons .= '' . -- 2.39.5