public AuthorizationURI Find(ProcessURI uri)
 {
     foreach (AuthorizationURI authorizationURI in this)
         if (uri.ToString().Contains(authorizationURI.Pattern))
             return authorizationURI;
     return null;
 }
Ejemplo n.º 2
0
        private static void SaveChange(ProcessURI uri, object obj)
        {
            if (obj != null)
            {
                object userId = null;
                if (SecurityHelper.IsAuthenticated)
                {
                    var token = SecurityHelper.AuthenticationToken;
                    userId = ContextFactory.GetContext(token.GetType()).GetID(token);
                }
                var entityId = ContextFactory.GetContext(obj.GetType()).GetID(obj);

                var change = new EntityChange(DateTime.Now, uri.ToString(), entityId, obj, userId != null ? userId.ToString() : null);
                ContextFactory.GetContext(typeof(EntityChange)).Insert(change);
            }
        }
Ejemplo n.º 3
0
 internal bool IsUriTemplate(ProcessURI uri)
 {
     if (uri != null)
     {
         const string filterKey = UriFilterKey + FilterKeySeparator;
         return uri.ToString().Contains(Filter.Replace(filterKey, string.Empty));
     }
     return false;
 }