@@ -22,21 +22,10 @@ namespace DotNetNuke.Modules.ActiveForums.Controllers
22
22
{
23
23
using System ;
24
24
using System . Collections . Specialized ;
25
- using System . Data ;
26
- using System . Drawing ;
27
25
using System . Linq ;
28
- using System . Reflection ;
29
- using System . Security . Cryptography ;
30
- using System . Web . Razor . Parser . SyntaxTree ;
31
- using System . Web . Security ;
32
- using System . Web . UI . WebControls ;
26
+ using System . Linq . Expressions ;
33
27
34
28
using DotNetNuke . Abstractions . Portals ;
35
- using DotNetNuke . Common . Controls ;
36
- using DotNetNuke . Entities . Portals ;
37
- using DotNetNuke . Modules . ActiveForums . API ;
38
- using DotNetNuke . Modules . ActiveForums . DAL2 ;
39
- using Microsoft . ApplicationBlocks . Data ;
40
29
41
30
internal class PermissionController : DotNetNuke . Modules . ActiveForums . Controllers . RepositoryControllerBase < DotNetNuke . Modules . ActiveForums . Entities . PermissionInfo >
42
31
{
@@ -67,6 +56,7 @@ internal class PermissionController : DotNetNuke.Modules.ActiveForums.Controller
67
56
internal new DotNetNuke . Modules . ActiveForums . Entities . PermissionInfo Update ( DotNetNuke . Modules . ActiveForums . Entities . PermissionInfo permissionInfo )
68
57
{
69
58
var cachekey = this . GetCacheKey ( moduleId : permissionInfo . ModuleId , id : permissionInfo . PermissionsId ) ;
59
+ DataCache . SettingsCacheClear ( permissionInfo . ModuleId , cachekey ) ;
70
60
base . Update ( permissionInfo ) ;
71
61
return this . GetById ( permissionInfo . PermissionsId , permissionInfo . ModuleId ) ;
72
62
}
@@ -616,12 +606,38 @@ public static string RemovePermFromSet(string objectId, int objectType, string p
616
606
return newSet ;
617
607
}
618
608
609
+ public static string SortPermissionSetMembers ( string permissionSet )
610
+ {
611
+ if ( string . IsNullOrEmpty ( permissionSet ) )
612
+ {
613
+ return string . Empty ;
614
+ }
615
+
616
+ string newSet = string . Empty ;
617
+
618
+ string [ ] permSet = permissionSet . Split ( '|' ) ;
619
+ for ( int section = 0 ; section < 2 ; section ++ )
620
+ {
621
+ var members = permSet [ section ] . Split ( ";" . ToCharArray ( ) , StringSplitOptions . RemoveEmptyEntries ) . ToArray ( ) ;
622
+ Array . Sort ( members ) ;
623
+ permSet [ section ] = string . Join ( ";" , members ) ;
624
+ if ( ! string . IsNullOrEmpty ( permSet [ section ] ) )
625
+ {
626
+ permSet [ section ] += ";" ;
627
+ }
628
+
629
+ newSet += string . Concat ( permSet [ section ] , "|" ) ;
630
+ }
631
+
632
+ return newSet ;
633
+ }
634
+
619
635
public static string AddPermToSet ( string objectId , int objectType , string permissionSet )
620
636
{
621
637
string newSet = RemovePermFromSet ( objectId , objectType , permissionSet ) ;
622
638
string [ ] permSet = newSet . Split ( '|' ) ;
623
- permSet [ objectType ] += string . Concat ( objectId , ";" ) ;
624
- newSet = string . Concat ( permSet [ 0 ] + "|" + permSet [ 1 ] + "|" + permSet [ 2 ] , "|" ) ;
639
+ permSet [ objectType ] += SortPermissionSetMembers ( string . Concat ( objectId , ";" ) ) ;
640
+ newSet = string . Concat ( permSet [ 0 ] + "|" + ( permSet . Length > 1 ? permSet [ 1 ] : string . Empty ) + "|" + ( permSet . Length > 2 ? permSet [ 2 ] : string . Empty ) , "|" ) ;
625
641
return newSet ;
626
642
}
627
643
@@ -647,20 +663,20 @@ internal static string GetSecureObjectList(IPortalSettings portalSettings, DotNe
647
663
648
664
roleObjects = GetObjFromSecObj ( portalSettings , s . Announce , objectType , roleObjects ) ;
649
665
roleObjects = GetObjFromSecObj ( portalSettings , s . Attach , objectType , roleObjects ) ;
666
+ roleObjects = GetObjFromSecObj ( portalSettings , s . Ban , objectType , roleObjects ) ;
650
667
roleObjects = GetObjFromSecObj ( portalSettings , s . Categorize , objectType , roleObjects ) ;
651
668
roleObjects = GetObjFromSecObj ( portalSettings , s . Create , objectType , roleObjects ) ;
652
669
roleObjects = GetObjFromSecObj ( portalSettings , s . Delete , objectType , roleObjects ) ;
653
670
roleObjects = GetObjFromSecObj ( portalSettings , s . Edit , objectType , roleObjects ) ;
654
671
roleObjects = GetObjFromSecObj ( portalSettings , s . Lock , objectType , roleObjects ) ;
655
672
roleObjects = GetObjFromSecObj ( portalSettings , s . Moderate , objectType , roleObjects ) ;
656
673
roleObjects = GetObjFromSecObj ( portalSettings , s . Move , objectType , roleObjects ) ;
657
- roleObjects = GetObjFromSecObj ( portalSettings , s . Split , objectType , roleObjects ) ;
658
- roleObjects = GetObjFromSecObj ( portalSettings , s . Ban , objectType , roleObjects ) ;
659
674
roleObjects = GetObjFromSecObj ( portalSettings , s . Pin , objectType , roleObjects ) ;
660
675
roleObjects = GetObjFromSecObj ( portalSettings , s . Poll , objectType , roleObjects ) ;
661
676
roleObjects = GetObjFromSecObj ( portalSettings , s . Prioritize , objectType , roleObjects ) ;
662
677
roleObjects = GetObjFromSecObj ( portalSettings , s . Read , objectType , roleObjects ) ;
663
678
roleObjects = GetObjFromSecObj ( portalSettings , s . Reply , objectType , roleObjects ) ;
679
+ roleObjects = GetObjFromSecObj ( portalSettings , s . Split , objectType , roleObjects ) ;
664
680
roleObjects = GetObjFromSecObj ( portalSettings , s . Subscribe , objectType , roleObjects ) ;
665
681
roleObjects = GetObjFromSecObj ( portalSettings , s . Tag , objectType , roleObjects ) ;
666
682
roleObjects = GetObjFromSecObj ( portalSettings , s . Trust , objectType , roleObjects ) ;
0 commit comments