/** * Prepares the update */ public function get_update(array $args) { $this->load_object($args); if (com_meego_devprogram_utils::is_current_user_creator_or_admin($this->object) || com_meego_devprogram_membutils::is_current_user_member_of_provider($this->object->id)) { // if creator // or admin // or good enough member parent::get_update($args); } else { $redirect = com_meego_devprogram_utils::get_url('provider_read', array('provider_name' => $args['provider_name'])); // redirect to the read page $this->mvc->head->relocate($redirect); } }
/** * Prepares and shows the my membership update page (cmd-my-membership-update) * * Access: only owners of the membership can update * * @param array args */ public function get_update(array $args) { // set myapps to be able to show a warning $this->data['mymemberships'] = false; parent::get_update($args); }