accessMod = db.AccessMods.First(n => n.RoleId == role.RoleId);
JavaScriptSerializer json_serializer = new JavaScriptSerializer();
List<string> returnMods = new List<string>();
if (userRoles.Count != 0)
{
foreach (var role in userRoles)
{
accessMod = db.AccessMods.First(n => n.RoleId == role.RoleId);
accessModString = (List<AccessModString>)json_serializer.DeserializeObject(accessMod.AccessString);
foreach (var item in accessModString)
{
if (item.Name == nameMod)
{
returnMods.Add(item.Mod);
}
}
}
return Ok(returnMods);
}
factory.addStageLink = function (stageLink) {
var deferred = $q.defer();
$http.post(pathApiProjectStageLinks + '/', stageLink).success(function (id) {
deferred.resolve(id);
notifications.add('success', 'Связь добавлена!');
}).error(function () {
notifications.add('danger', 'Связь не добавлена!');
});
return deferred.promise;
};
prstageRepository.addStageLink (stageLink).then(function(id){
...
})