public void AuthorizedAdmin_CanWriteToObject_AuthorizedForAdminOnlyWrite()
        {
            var context = GetContext();

            SilverlightPrincipal.Logout();
            SilverlightPrincipal.LoginUsingMembershipProviderDatPortal("admin", "12345", (o, e) =>
            {
                var item = new OnlyAdminCanWrite();

                item.A = "test";//no SecurityException

                context.Assert.Success();
            });

            context.Complete();
        }
Beispiel #2
0
        public void AuthorizedAdmin_CanWriteToObject_AuthorizedForAdminOnlyWrite()
        {
            var context = GetContext();

              SilverlightPrincipal.Logout();
              SilverlightPrincipal.LoginUsingMembershipProviderDatPortal("admin", "12345", (o, e) =>
              {
            var item = new OnlyAdminCanWrite();

            item.A = "test";//no SecurityException

            context.Assert.Success();
              });

              context.Complete();
        }
        public void AuthorizedUser_CanNotWriteToObject_AuthorizedForAdminOnlyWrite()
        {
            var context = GetContext();

            SilverlightPrincipal.Logout();
            SilverlightPrincipal.LoginUsingMembershipProviderDatPortal("user", "1234", (o, e) =>
            {
                var item = new OnlyAdminCanWrite();

                context.Assert.Try(() =>
                {
                    item.A = "test";
                });
                context.Assert.Fail();//assure that exception was thrown for Assert.Try
                context.Assert.Success();
            });

            context.Complete();
        }
Beispiel #4
0
        public void AuthorizedUser_CanNotWriteToObject_AuthorizedForAdminOnlyWrite()
        {
            var context = GetContext();

              SilverlightPrincipal.Logout();
              SilverlightPrincipal.LoginUsingMembershipProviderDatPortal("user", "1234", (o, e) =>
              {
            var item = new OnlyAdminCanWrite();

            context.Assert.Try(() =>
            {
              item.A = "test";
            });
            context.Assert.Fail();//assure that exception was thrown for Assert.Try
            context.Assert.Success();
              });

              context.Complete();
        }