Esempio n. 1
0
 /// <summary>
 /// A parcel can only be updated or removed if not within an active project or user has admin-properties permission
 /// </summary>
 /// <param name="service"></param>
 /// <param name="project"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public static void ThrowIfNotAllowedToUpdate(this BaseService service, Entity.Project project, ProjectOptions options)
 {
     if (project != null && !project.IsProjectEditable(service.GetUser(), options))
     {
         throw new NotAuthorizedException("Cannot update or delete an active project.");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// A parcel can only be updated or removed if not within an active project or user has admin-properties permission
 /// </summary>
 /// <param name="service"></param>
 /// <param name="project"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public static bool IsAllowedToUpdate(this BaseService service, Entity.Project project, ProjectOptions options)
 {
     return(project != null && project.IsProjectEditable(service.GetUser(), options));
 }