<template>
    <v-card tile flat>
        <user-roles-detailed-list-item
            v-for="(role, index) in myroles" 
            :key="'role-' + index"
            :app="app"
            :role="role"
            :user="user"
            class="mb-2"
        /> 
    </v-card>
</template>

<script>
    export default {
        props: {
            app: {required: true},
            user: {required: true},
        },

        computed: {
            myroles() {
                if(this.app.platform == 'admin')
                {
                    return this.user.roles;
                }
                return _.filter(this.user.roles, role => role.type == 'b2b');
            }
        },

        name: 'UserRolesDetailedList',
    }
</script>