Commit b97d01f6 authored by ZeMKI's avatar ZeMKI
Browse files

Optimization and bugfix

- now the edit study button is correctly blurried if you can't edit the study
- fixed bug when inviting an existing user (email send is still not working on the server)
parent dd937196
......@@ -187,7 +187,7 @@ class UserController extends Controller
if ($userexist) {
$userexist->syncRoles([$role], $study);
$user->attachPermissions($editpermissions, $study);
$userexist->attachPermissions($editpermissions, $study);
return response("User ".$userexist->email." has been assigned to the selected studies");
} else {
......
<template>
<section >
<div class="column" v-for="user in usersinstudy" v-if="user['email'] != 'belli@uni-bremen.de' ">
<div class="column" v-for="user in usersinstudy" v-if="user['email'] != 'belli@uni-bremen.de' && user['email'] != auth['email'] ">
<div class="level has-background-light" style="padding: 3px">
<div class="level-left" @click="confirmdeleteuser(user)"><b-icon icon="delete-sweep" class="has-text-danger " ></b-icon></div>
<div class="level-right">{{user['email']}}</div>
</div>
......@@ -14,8 +15,8 @@
<div class="level" v-for="role in user['roles']">
<div class="level-left"><span class="tag is-primary">{{role['name']}}</span></div>
</div>
<label class="checkbox" @change="changeeditpermission(caneditthisstudy[user['id']],user['id'])">
<input type="checkbox" v-model="caneditthisstudy[user['id']]">
<label class="checkbox" @change="changeeditpermission(caneditthisstudy[user['id']],user['id'])" :disabled="studyeditable == false">
<input type="checkbox" v-model="caneditthisstudy[user['id']]" :disabled="studyeditable == false">
Can edit <strong>this</strong> study
</label>
<label class="checkbox" @change="changestudiespermission(cancreatestudies[user['id']],user)">
......@@ -31,7 +32,7 @@
<script>
export default {
props: ['usersinstudy','study'],
props: ['usersinstudy','study','auth','studyeditable'],
data() {
return {
caneditthisstudy: {},
......
......@@ -90,7 +90,7 @@
<span data-toggle="tab" id="adduser{{$study->id}}"> Users <b-tag rounded> {{$study->users->count()}} </b-tag> </span>
</template>
<userpart :usersinstudy="users['{{$study->id}}'] ? users['{{$study->id}}'] : {{$study->users}} " :study="{{$study->id}}" v-on:parentshowmodal="showmodal(null,{{$study->id}})" ref="userpart{{$study->id}}"></userpart>
<userpart :studyeditable="{{ (Auth::user()->can('update-studies',$study->name)) ? 'true' : 'false'}}" :auth="{{Auth::user()}}" :usersinstudy="users['{{$study->id}}'] ? users['{{$study->id}}'] : {{$study->users}} " :study="{{$study->id}}" v-on:parentshowmodal="showmodal(null,{{$study->id}})" ref="userpart{{$study->id}}"></userpart>
</b-tab-item>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment