Autor Beitrag
delphijanka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Mi 19.08.09 12:31 
Hallo.

Folgende Situation:

ein Benutzer meldet sich in der DB, und je nach dem, welche ROLE ihm zugewiesen ist, deaktiviert mein Delphi-Programm bestimmte Menüpunkte. Wie kann ich also ermitteln, welche Rollen dem Benutzer zugewiesen sind?

Danke.


Zuletzt bearbeitet von delphijanka am Mi 19.08.09 12:34, insgesamt 1-mal bearbeitet
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 19.08.09 12:32 
Welches DBMS?

_________________
Markus Kinzler.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Mi 19.08.09 12:36 
@mkinzler

habe den Titel spezifiziert.
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Mi 19.08.09 12:41 
Ich mache das so, dass ich der Reihe nach alle möglichen Rollen durchprobiere. Wenn eine Rolle nicht aktiviert werden kann, gibts eine Exception, die ich gezielt abfange.

Ansonsten gibts die System-Tabelle DBA_ROLE_PRIVS, da steht drin, welcher User welche Rolle(n) hat. Auf diese Tabelle braucht man aber DBA Rechte.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Mi 19.08.09 12:45 
@iKilledKenny schreibt:

"Ich mache das so, dass ich der Reihe nach alle möglichen Rollen durchprobiere. Wenn eine Rolle nicht aktiviert werden kann, gibts eine Exception, die ich gezielt abfange."

verstehe deinen Ansatz nicht wirklich.
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Mi 19.08.09 12:56 
Was verstehst du denn daran nicht?
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Mi 19.08.09 12:58 
@iKilledKenny

Verstehe gar nichts. Bitte beschreibe es detaillierter.
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Mi 19.08.09 13:01 
Detaillierter gehts nicht. Du probierst der Reihe nach alle Rollen deiner Applikation durch. Die, die der User hat, gehen gut, die anderen geben eine Exception, die man gezielt abfangen kann.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Do 20.08.09 12:34 
Hier im Net gufunden:

Aktuellen user lesen:

SELECT user FROM DUAL;

Rechte lesen:

SELECT * FROM USER_ROLE_PRIVS WHERE USERNAME = USER ;

2. Spalte der Tabelle "USER_ROLE_PRIVS" heisst "GRANTED_ROLE" und enthält die Namen der Rollen, die der User hat.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 20.08.09 14:44 
iKilledKenny: Und um zu testen ob die Ampel rot ist fährst du über die Kreuzung und guckst ob einer in dich reinfährt. :wink:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Do 20.08.09 15:04 
Da hat wohl einer nen Clown gefrühstückt... 8)