Webserver: Fixed a userrights bug
This commit is contained in:
1 parent
4c932ba85c
commit
e68dafd16e
4 files changed
+22
-22
No files matched your search
@@ -48,12 +48,12 @@ namespace ServerLib
|
||||
{
|
||||
_ActiveSessions.Remove(s.Key);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal static bool RequestRight(Guid sessionId, EUserRights requestedRight)
|
||||
{
|
||||
return ((CUserRoleControl.GetUserRightsFromUserRole(_ActiveSessions[sessionId].Roles) & requestedRight) != 0);
|
||||
return ((CUserRoleControl.GetUserRightsFromUserRole(_ActiveSessions[sessionId].Roles)
|
||||
.HasFlag(requestedRight)));
|
||||
}
|
||||
|
||||
internal static int GetUserIdFromSession(Guid sessionId)
|
||||
|
||||
@@ -5,15 +5,15 @@ namespace ServerLib
|
||||
[Flags]
|
||||
internal enum EUserRights
|
||||
{
|
||||
None = 0x00,
|
||||
EditAllProfiles = 0x01,
|
||||
UploadPhotos = 0x02,
|
||||
ViewOtherProfiles = 0x04,
|
||||
UseKeyboard = 0x08,
|
||||
ReorderPlaylists = 0x16,
|
||||
AddSongToPlaylist = 0x32,
|
||||
CreatePlaylists = 0x64,
|
||||
DeletePlaylists = 0x128,
|
||||
RemoveSongsFromPlaylists = 0x256
|
||||
None = 0,
|
||||
EditAllProfiles = 1,
|
||||
UploadPhotos = 2,
|
||||
ViewOtherProfiles = 4,
|
||||
UseKeyboard = 8,
|
||||
ReorderPlaylists = 16,
|
||||
AddSongToPlaylist = 32,
|
||||
CreatePlaylists = 64,
|
||||
DeletePlaylists = 128,
|
||||
RemoveSongsFromPlaylists = 256
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace ServerLib
|
||||
[Flags]
|
||||
internal enum EUserRoles
|
||||
{
|
||||
AuthenticatedUser = 0x00,
|
||||
Administrator = 0x01
|
||||
AuthenticatedUser = 0,
|
||||
Administrator = 1
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user