//wrapper that tries both injection routines if one or the other fails public static bool DoProcessInjection(IntPtr targetWindow, string targetWindowName, string dllpath) { //set SE_DEBUG_NAME privilege SecurityPrivilege.SetPrivileges(); //if one attempt fails try the other if (!InjectOne(targetWindow, targetWindowName, dllpath)) { if (!InjectTwo(targetWindow, targetWindowName, dllpath)) { return(false); } } return(true); }
public static TargetPrivilegePair Pair(SecurityTarget target, SecurityPrivilege privilege, Func <HtmlHelper, IHtmlString> view) { return(new TargetPrivilegePair { TargetId = target.Id(), PrivilegeId = privilege.SID, View = view }); }
/// <summary> /// Initiaze the global variable /// </summary> /// <param name="securityPrivilege">Selected SecurityPrivilege element</param> public CreateLabels_SecurityPrivilege(SecurityPrivilege securityPrivilege) { this.securityPrivilege = securityPrivilege; }
public static IQueryable <AuditEventView> RequirePermission <TDomain>(this IQueryable <AuditEventView> events, IEnumerable <AuditEventKind> allKinds, ISecurityService <TDomain> sec, SecurityPrivilege privilege, ISecuritySubject subject) { throw new Lpp.Utilities.CodeToBeUpdatedException(); //var evts = events.HomomorphismRestrictionWorkaround(); //return allKinds // .ToLookup( k => k.AppliesTo.ObjectKindsInOrder.Count() ) // .Aggregate( // Enumerable.Empty<AuditEventView>(), // TODO: EF4 doesn't support UNION on complex types or UNION with subsequent operations. // // Make this into IQueryable as soon as we move to EF4.5 // ( es, a ) => // { // var takeNminusOne = BigTupleExpression.Take<Guid>( a.Key ); // var initKindField = BigTuple<Guid>.InitializerExpression( a.Key+1, a.Key-1 ); // var takeN = BigTupleExpression.Take<Guid>( a.Key+1 ); // var kinds = a.Select( e => e.Id ); // var res = from e in evts // where kinds.Contains( e.KindId ) // join g in sec.AllGrantedTargets( subject, privilege, a.Key+1 ) // on initKindField.Invoke( takeNminusOne.Invoke( e.TargetId ), e.KindId ) equals takeN.Invoke( g ) // select e; // return es.Concat( res.Expand() ); // } // ) // .AsQueryable(); }
ActionResult ManipulateRequest(string sFolderId, string sRequestId, Action <RequestSharedFolder, Request> action, SecurityPrivilege demand) { throw new Lpp.Utilities.CodeToBeUpdatedException(); //var x = from folderId in Maybe.Parse<int>(int.TryParse, sFolderId) // from requestId in Maybe.Parse<int>(int.TryParse, sRequestId) // from folder in SharedFolders.Find(folderId) // from req in RequestController.Requests.Find(requestId) // from _ in Maybe.Do(() => Security.Demand(folder, Auth.CurrentUser, demand)) // from __ in Maybe.Do(() => Security.Demand(Sec.Target(req.Project, req.Organization, req.CreatedByUser), Auth.CurrentUser, SecPrivileges.Crud.Edit)) // select Maybe.Do(() => // { // action(folder, req); // UnitOfWork.Commit(); // }); //if (x.Kind == MaybeKind.Null) return HttpNotFound(); //if (x.Kind == MaybeKind.Error && x.Exception is UnauthorizedAccessException) return new ContentResult { Content = "Auth" }; //return new ContentResult { Content = "OK" }; }