From 5c08f401d1c002cafb454a2c8bd91a0063a1ff88 Mon Sep 17 00:00:00 2001 From: Damien Lebrun Date: Mon, 31 Aug 2015 11:02:16 +0100 Subject: [PATCH] Allow admins to update any profile. --- .../components/profiles/profiles-view-clm-profile.html | 2 +- .../components/profiles/profiles-view-show.html | 6 +++--- src/classmentors/components/profiles/profiles.js | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/classmentors/components/profiles/profiles-view-clm-profile.html b/src/classmentors/components/profiles/profiles-view-clm-profile.html index 131df77..328d364 100644 --- a/src/classmentors/components/profiles/profiles-view-clm-profile.html +++ b/src/classmentors/components/profiles/profiles-view-clm-profile.html @@ -5,7 +5,7 @@

- registered as {{profile.services[serviceId].details.name}}

- + diff --git a/src/classmentors/components/profiles/profiles-view-show.html b/src/classmentors/components/profiles/profiles-view-show.html index 247cac9..4b26309 100644 --- a/src/classmentors/components/profiles/profiles-view-show.html +++ b/src/classmentors/components/profiles/profiles-view-show.html @@ -15,9 +15,9 @@

-
-
-
+
+
+

Code Combat

diff --git a/src/classmentors/components/profiles/profiles.js b/src/classmentors/components/profiles/profiles.js index b4bf2b7..80c1043 100644 --- a/src/classmentors/components/profiles/profiles.js +++ b/src/classmentors/components/profiles/profiles.js @@ -340,6 +340,14 @@ ); }; + this.canRemove = function() { + return ( + $scope.profile && + $scope.currentUser && + $scope.profile.$id === $scope.currentUser.$id + ); + }; + this.update = function() { return clmDataStore.services[$scope.serviceId].updateProfile( $scope.profile