You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shiro.apache.org by "xian1295004710 (via GitHub)" <gi...@apache.org> on 2023/09/01 05:19:57 UTC

[GitHub] [shiro] xian1295004710 opened a new issue, #1057: [Question]PermissionAnnotationHandler.java line 81~86

xian1295004710 opened a new issue, #1057:
URL: https://github.com/apache/shiro/issues/1057

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/shiro/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Question
   
   ![image](https://github.com/apache/shiro/assets/143772347/7adcc344-1d3f-4fa4-bc9b-85b94df55e80)
   I think there is a bug in these lines,but I can not make sure.
   I think variable 'hasAtLeastOnePermission'  always equals to 'getSubject().isPermitted(perms[perms.length-1])', is this result a bug?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] lprimak commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "lprimak (via GitHub)" <gi...@apache.org>.
lprimak commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1704563855

   > I feel very embarrassed 
   
   Absolutely no need. Your question prompted the cleanup of the code, it was indeed confusing, so thank you for your contribution!
   
   Always ask questions!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] lprimak commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "lprimak (via GitHub)" <gi...@apache.org>.
lprimak commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1703787321

   I don't see how... the variable is set to true only if any permission is present... hence the variable name.
   Am I not seeing something you are seeing? In my view it looks like it works as designed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] fpapon commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "fpapon (via GitHub)" <gi...@apache.org>.
fpapon commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1704615935

   @xian1295004710 don't worry, there is no stupid question! Thank you for asking and using Apache Shiro!
   We hope you will add your first contribution soon :)
   Don't hesitate!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] fpapon commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "fpapon (via GitHub)" <gi...@apache.org>.
fpapon commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1704324742

   @xian1295004710 HasAtLeastOnePermission is always = true only for the latest valid permission of the list, if a check is false, the variable is not set, I think this is your misunderstanding.
   
   The logic is that if we don't find any permitted permission in the list, we check the first permission to raise an error with a message related to the check.
   
   Side note: We can optimize a little by adding a break into the loop after setting **hasAtLeatOnePermission** to true.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] xian1295004710 commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "xian1295004710 (via GitHub)" <gi...@apache.org>.
xian1295004710 commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1704637578

   I'm very glad to hear that (^o^), and thanks for your encouragement. It could make my day!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] xian1295004710 commented on issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "xian1295004710 (via GitHub)" <gi...@apache.org>.
xian1295004710 commented on issue #1057:
URL: https://github.com/apache/shiro/issues/1057#issuecomment-1704524694

   @lprimak @fpapon Thank you for taking time to answer the question very much.  I am a newbie. I feel very embarrassed about that misunderstanding, I could run a test by myself, but I was too confident to ask that silly question, which  makes your precious time wasted.  I hope you don't mind.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org


[GitHub] [shiro] lprimak closed issue #1057: [Question]PermissionAnnotationHandler.java line 81~86

Posted by "lprimak (via GitHub)" <gi...@apache.org>.
lprimak closed issue #1057: [Question]PermissionAnnotationHandler.java line 81~86
URL: https://github.com/apache/shiro/issues/1057


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org