Skip to content

Instantly share code, notes, and snippets.

@janderit
Created November 7, 2012 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janderit/4031154 to your computer and use it in GitHub Desktop.
Save janderit/4031154 to your computer and use it in GitHub Desktop.
Domänendefinition
namespace Target.Sicherheit
{
public enum Entitaeten
{
Benutzersitzung
}
public enum Rechte
{
InteraktiveAnmelden,
AktiveSitzung,
[Objektbezug(Entitaeten.Benutzersitzung)]
SitzungsinformationenLesen
}
[Resource("Sicherheit.Sitzungsinfo",1,0)]
public class Sitzungsinfo
{
[Handle(Entitaeten.Benutzersitzung)]
[Entitaet]
public Guid SitzungId;
public bool Authentifiziert;
public DateTime Beginn;
public DateTime TimeoutAt;
}
[UsecaseGruppe("Benutzersitzung")][RestApiNamespace(@"~/sicherheit/sitzung")]
public interface Benutzersitzung
{
[Command("Benutzer anmelden")][RestApiCommand(@"~/login")]
void AuthentifiziereBenutzer([Handle(Entitaeten.Benutzersitzung)][New]Guid neueSitzungId, string mandant, string benutzername, [Sensitive]string klartextpasswort);
[Command("Abmelden")][RestApiCommand(@"~/(<sitzungId>)/logout")]
[Hinreichend(Rechte.AktiveSitzung, Administration.Rechte.Serveradministrieren)]
void BeendeSitzung([Handle(Entitaeten.Benutzersitzung)]Guid sitzungId);
[Command("Sitzung verlängern")][RestApiCommand(@"~/(<sitzungId>)/keepalive")]
[Hinreichend(Rechte.AktiveSitzung)]
void SitzungKeepAlive([Handle(Entitaeten.Benutzersitzung)]Guid sitzungId);
[Query("Informationen zur Sitzung")][RestApiResource(@"~/(<sitzungId>")]
[Hinreichend(Rechte.SitzungsinformationenLesen, Administration.Rechte.Serveradministrieren)]
Sitzungsinfo Info([Handle(Entitaeten.Benutzersitzung)] Guid sitzungId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment