Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Security Framework Teaser

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Security Framework Teaser

    Jerry helped me many months ago to add some ability to my application where I wanted to be able to delete a user from Security Framework through a normal Grid. I recently revisited this concept to be able to toggle the user's Security Group also from a normal Grid; so I thought I would show how.

    If you use the Security Framework, you know the normal online method to delete a user from Security or to change their Security Group is to use a Dialog and some Event code. But take a look at the image below. That's an absolutely normal Grid with no tricks at all. However, if the user checks the Delete box and presses Submit, it deletes the user from Security Framework. Similarly, if they check or uncheck the "Mgr?" checkbox, it will toggle the user in or out of a particular Security Group.

    So for fun, and because I'd like to see who is interested, I thought I would offer this up as a teaser - any guesses as to how I do this?
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  • #2
    Re: Security Framework Teaser

    Hello Steve,
    Not sure yet how you did that. Thanks, now you are making me rethink my current method :) I'm interested but don't tell yet!

    I also created a grid to delete the user's account. If the user no longer wishes to be a member, he/she goes to this grid. User must be logged in. This grid not only deletes the user from security but at the same time deletes all the user's records in all of the tables associated with said user.

    My pic may not look pretty (I'm now in the aesthetic stage of my development) but it does do the trick.

    Among other things, I have this in my CanDeleteRecord under events.

    dim tbl as P
    dim qry as P
    tbl = table.open("[pathalias.adb_path]\sites")
    'Perform a query to find user records for deletion.
    query.filter = "Userid =" + quote(session.__protected__userid)
    query.order = "Recno()"
    qry = tbl.query_create()
    tbl.delete_range()
    tbl.close()

    a5ws_Delete_User(session.__protected__userid) <-- deletes user from security

    Sorry if I went on a tangent on your thread... :(
    Last edited by EricN; 05-14-2008, 05:12 PM.
    Eric

    Alpha Five Websites
    longlivepuppies.com
    socialservicenetwork.com
    -------------------------------------------------
    socialservicenetwork.org

    Comment


    • #3
      Re: Security Framework Teaser

      Nice! This "teaser" format may be a great way to discuss abstract concepts towards finding common or better solutions. Your approach is one way, but not how I approached it. I don't have any code in the Events. I get nervous about running extensive code in the Grid Events because I'm not sure I can adequately respond to errors.
      Steve Wood
      Join the ALPHA DEVELOPERS NETWORK
      There is no Cloud. It's just someone else's computer.
      Web - Mobile - Hosting - Products - Frameworks - Developer Resources
      AlphaToGo | IADN (100% Alpha Anywhere Websites)

      Comment


      • #4
        Re: Security Framework Teaser

        Whenever you wish to share the secret, we're all ears (and eyes).
        Peter
        AlphaBase Solutions, LLC

        Peter@AlphaBaseSolutions.com
        https://www.alphabasesolutions.com


        Comment


        • #5
          Re: Security Framework Teaser

          I'll show how to delete the record, but I was looking for a discussion rather than just posting the how-to. I must be overestimating the interest.

          This code goes in the A5W page and was originally provided by Jerry and I used the concept for other effects, like toggling the user's Security Groups. It will both delete the user from Security and the table associated with the Grid. What is significant about this (along with other tricks) is it lets you manage your Users in bulk a normal Grid rather than individually in Dialogs.

          Toggling the Security Group (which I don't show below) takes about five more lines of code because you need to know the user's current security groups before you can write back the new set along with the one you are toggling.

          Code:
          dim chkrows as n
          with tmpl_comp_viewusers
          	componentName = "comp_viewusers"
          	chkrows = rows
          end with 
          
          '' DELETE CODE 
          dim deletelist as c
          for i = 1 to chkrows
           if eval_valid("V.R"+alltrim(str(i))+".CheckBox_Delete") = .T. 'delete checked
            deletelist = deletelist + eval("V.R"+alltrim(str(i))+".userid") + crlf()  ' assuming the field was named 'ulink'
           end if
          next
          
          for each foo in deletelist
          	a5ws_delete_user(foo.value,request)
          next
          Steve Wood
          Join the ALPHA DEVELOPERS NETWORK
          There is no Cloud. It's just someone else's computer.
          Web - Mobile - Hosting - Products - Frameworks - Developer Resources
          AlphaToGo | IADN (100% Alpha Anywhere Websites)

          Comment


          • #6
            Re: Security Framework Teaser

            I think that's a real nice technique Steve - appreciate you sharing it. I can predict a lot of uses for that.

            I know you wanted more discussion and speculation but dunno exactly how to have achieved that. Kinda hard to match Jerry's inventiveness...
            -Steve
            sigpic

            Comment


            • #7
              Re: Security Framework Teaser

              The key to being inventive it to know how Alpha Five works, not just working with Alpha. That, plus motivation towards constant improvement.

              With this teaser, I was trying to find another way of sharing and building knowledge, without just freely offering up everything I've labored over.
              Steve Wood
              Join the ALPHA DEVELOPERS NETWORK
              There is no Cloud. It's just someone else's computer.
              Web - Mobile - Hosting - Products - Frameworks - Developer Resources
              AlphaToGo | IADN (100% Alpha Anywhere Websites)

              Comment


              • #8
                Re: Security Framework Teaser

                Steve,
                I must be overestimating the interest
                I don't think so. The interest is there (here?), but believe that the expertise is not amongst most who frequent the board. I am very interested but for future reference only so far, given the time restraints I have currently.

                I know that you and Steve Workings are two who give quite a bit of the support the rest of the users who are trying to develop web applications get and want you both to know it is very much appreciated by me and am sure all others who have benefited from the expertise.

                I can only hope that I and others will pick up enough information that has been presented here in order to contribute some also...instead of just a few who are currently taking the teaching/helping task almost entirely by themselves...I have noticed a couple of other users here lately who also have been answering questions--just need maybe 10 more now!!
                Mike
                __________________________________________
                It is only when we forget all our learning that we begin to know.
                It's not what you look at that matters, it's what you see.
                Henry David Thoreau
                __________________________________________



                Comment


                • #9
                  Re: Security Framework Teaser

                  Originally posted by MikeC View Post
                  ...and want you both to know it is very much appreciated by me and am sure all others who have benefited from the expertise.
                  I concur. If it weren't for you guys, I would probably have given up!
                  Eric

                  Alpha Five Websites
                  longlivepuppies.com
                  socialservicenetwork.com
                  -------------------------------------------------
                  socialservicenetwork.org

                  Comment


                  • #10
                    Re: Security Framework Teaser

                    ever get the feeling your looking at a polar bear in a snow storm? I am always interested in new ideas and methods to do anything alpha5 - I just dont always know what I am looking at, lol. Having never really worked with the security framework beyond the point and click wysiwyg I am just staring at a black cat in a dark room - but at least I know its there!
                    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                    Comment

                    Working...
                    X