|
|
|
@ -84,7 +84,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new NullReferenceException("Image not found");
|
|
|
|
|
throw new NoteImageNotFoundException("Image not found");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -92,14 +92,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool VerifyPrivilege(User user)
|
|
|
|
|
{
|
|
|
|
|
if (Editors.Contains(user))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new NullReferenceException("User is not an editor");
|
|
|
|
|
}
|
|
|
|
|
return Editors.Contains(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -108,7 +101,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
public void AddCollaborator(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (VerifyOwner(owner)) { Collaborators.Add(user); }
|
|
|
|
|
else { throw new NullReferenceException("User is not the owner"); }
|
|
|
|
|
else { throw new UserNotOwnerException("User is not the owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -117,7 +110,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
public void RemoveCollaborator(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (VerifyOwner(owner)) { Collaborators.Remove(user); }
|
|
|
|
|
else { throw new NullReferenceException("User is not the owner"); }
|
|
|
|
|
else { throw new UserNotOwnerException("User is not the owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -126,7 +119,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
public void AddEditor(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (VerifyOwner(owner)) { Editors.Add(user); }
|
|
|
|
|
else { throw new NullReferenceException("User is not the owner"); }
|
|
|
|
|
else { throw new UserNotOwnerException("User is not the owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -135,7 +128,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
public void RemoveEditor(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (VerifyOwner(owner)) { Editors.Remove(user); }
|
|
|
|
|
else { throw new NullReferenceException("User is not the owner"); }
|
|
|
|
|
else { throw new UserNotOwnerException("User is not the owner"); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|