Haunted Blue's profileThe Cheese RedemptionBlogLists Tools Help

Blog


    October 07

    其实我不想写与工作有关系的话题

         一般不在space里写技术有关的东西,纯粹当乐一乐吧,这解决方案看得我只能用哭笑不得来形容。

         今天改一程序,有关权限控制的:一个系统内有三类的用户,系统有N个功能,每个功能能被一类或者几类用户所使用。我看到的解决方案如下:

         三类用户分别给三种标识:a, ab, abcde,判断功能F能不能被使用时,F给定判定字符串s(s一般是a或者是ab或者是abcde),判定方法是s的长度小于等于用户标识串的长度,是则有权限访问,否则无权限访问。

         估计正常人看到这一步都没看明白,为啥是判断长度呢? 说实话,我也不知道。。。。。。囧

     

         程序本身比较简单,这样判断好像也不会出错,但我现在需要往上加一类用户,可就头疼了。。。。。。实在不想大规模地改代码,最后考虑到新加的用户类必然与原来的a类用户互斥,并肯定是ab,abcde两类用户的权限子集,只好加了一类用户叫b,把判定方法改成s必须是用户标识串的子字符串。。搞定。。。。。。

         人大脑的构造真是奇怪啊。。。奇怪。

     

         最近一直把想“吉祥三宝”设成手机彩铃,原先听LL设过这个彩铃,觉得非常好,晚上想了半天,又反复听了几遍,最后还是放弃了,怎么听都觉得这歌当彩铃太女性化,估计设置上了得被人嘲笑死。

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://cheesepana.spaces.live.com/blog/cns!580BB97B48890A80!917.trak
    Weblogs that reference this entry
    • None