投稿時間:2022-04-15 07:17:28 RSSフィード2022-04-15 07:00 分まとめ(22件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders 今、デジタル推進でCIOが注力すべき3つのアクション─ガートナー | IT Leaders https://it.impress.co.jp/articles/-/23021 gartner 2022-04-15 07:00:00
AWS AWS Modernize Your Audit Log Management Using AWS CloudTrail Lake | Amazon Web Services https://www.youtube.com/watch?v=aLkecCsHhxw Modernize Your Audit Log Management Using AWS CloudTrail Lake Amazon Web ServicesIn this video you ll see how to modernize your audit log management using AWS CloudTrail Lake With this platform you can create a managed immutable data lake of CloudTrail audit logs simplify CloudTrail analysis workflows and optimize your logs for analysis and query For more information on this topic please visit the resources below Subscribe More AWS videos More AWS events videos ABOUT AWSAmazon Web Services AWS is the world s most comprehensive and broadly adopted cloud platform offering over fully featured services from data centers globally Millions of customers ーincluding the fastest growing startups largest enterprises and leading government agencies ーare using AWS to lower costs become more agile and innovate faster AWS AmazonWebServices CloudComputing 2022-04-14 21:28:11
python Pythonタグが付けられた新着投稿 - Qiita 典型90問007 CP ClassesをPythonで解く! https://qiita.com/Chunky_RBP_chan/items/ff65c8d64f296730e56e atcoder 2022-04-15 06:14:56
Azure Azureタグが付けられた新着投稿 - Qiita ITableEntity の一部のプロパティを無視する方法 https://qiita.com/c-yan/items/6537932eaafd6924e2ce azuredatatables 2022-04-15 06:22:51
海外TECH Ars Technica Puzzling cases of severe liver disease in children spark international probe https://arstechnica.com/?p=1848183 culprits 2022-04-14 21:08:51
海外TECH MakeUseOf What Is Crypto Lending and How Does It Work? https://www.makeuseof.com/what-is-crypto-lending-and-how-does-it-work/ crypto 2022-04-14 21:30:14
海外TECH MakeUseOf 8 Online Tools to Find Your Doppelgänger https://www.makeuseof.com/online-tools-find-doppelganger/ online 2022-04-14 21:30:15
海外TECH MakeUseOf 10 Things to Check Before Buying a Second-Hand iPhone Online https://www.makeuseof.com/things-to-check-before-buying-second-hand-iphone-online/ iphone 2022-04-14 21:15:14
海外TECH DEV Community April 11th, 2022: VS Code Tip of the Week https://dev.to/vscodetips/april-11th-2022-vs-code-tip-of-the-week-16m7 April th VS Code Tip of the WeekThis week s tip of the week is care of Benjamin Pasero from the Twitters Local history has landed in VS Code It s currently only available in VS Code Insiders On another note I highly recommend the Insiders edition I ve been using it for years and it s super stable Benjamin Pasero benjaminpasero ️Local history landed in code Get back to older versions of a file and restore or compare as needed ️More details at code visualstudio com updates v …Become a Code insider code visualstudio com insiders PM Apr 2022-04-14 21:33:54
海外TECH DEV Community Complete Guide To Managing User Permissions In Rails Apps https://dev.to/honeybadger/complete-guide-to-managing-user-permissions-in-rails-apps-4dm6 Complete Guide To Managing User Permissions In Rails AppsThis article was originally written by Renata Marques on the Honeybadger Developer Blog A common requirement of web applications is the ability to assign specific roles and permissions Many types of web applications distinguish between admins and regular users in providing restricted access This is often performed using a simple boolean that determines whether the user is an admin However roles and permissions can become much more complex The value of your application lies in restricting access to certain data and actions It s definitely something you don t want to mess up In this post we will explain how to implement roles and permissions in a basic Ruby on Rails application Do I need a gem to manage permissions No you don t need a gem especially if your application is small and you want to avoid adding more dependencies to your code base However if you are looking for alternatives here are the most popular gems that deal with roles and permissions DeviseDevise is a gem for authentication and roles management and it is a really complex and robust solution With k stars on GitHub it is the most popular repo in this post but it does more than roles management It is known as an authentication solution so only apply it to your codebase if you need a very robust library Pundit Pundit is a gem that uses simple Ruby objects and it is probably the simplest policy gem we will cover Is simple to use has minimal authorization and is similar to using pure Ruby With k stars on GitHub it is currently the most popular policy gem CanCan CanCan is an authorization library that restricts the resources a given user is allowed to access However CanCan has been abandoned for years and only works with Rails and earlier releases CanCanCan CanCanCan is another authorization library for Ruby and Ruby on Rails It is an alternative to CanCan and is currently being maintained With k stars on GitHub it is the least popular but it works pretty well and is well maintained All of these gems are great but it s not too hard to build permissions yourself in plain Ruby I will show you how to manage permissions without a gem using a strategy called policy object pattern Policy object patternPolicy Object is a design pattern used to deal with permissions and roles You can use it each time you have to check whether something or someone is allowed to perform an action It encapsulates complex business rules and can easily be replaced by other policy objects with different rules All the external dependencies are injected into the policy object encapsulating the permission check logic which results in a clean controller and model Gems like Pundit Cancan and Cancancan implement this pattern Pure policy object rulesThe return has to be a boolean valueThe logic has to be simpleInside the method we should only call methods on the passed objects ImplementationLet s start with the naming convention the filename has the policy suffix applied and the class and policy at the end In this method names always end with the character e g UsersPolicy allowed Here is some example code class UsersPolicy def initialize user user user end def allowed admin editor end def editor user where editor true end def admin user where admin true endend In which scenarios should I use them When your app has more than one type of restricted access and restricted actions For example posts can be created with the following at least one tag a restriction that only admins and editors can create them anda requirement that editors need to be verified Here s an example controller without a policy object class PostsController lt ApplicationController def create if post tag ids size gt amp amp current user role admin current user role editor amp amp current user verified email create end endendBecause the above condition checks are long ugly and unreadable the policy object pattern should be applied Let s begin by creating PostsCreationPolicy class PostsCreationPolicy attr reader user post def initialize user post user user post post end def self create user post new user post create end def create with tags amp amp author is allowed end private def with tags post tag ids size gt end def author is allowed is admin editor is verified end def is admin user role admin end def editor is verified user role editor amp amp user verified email endendOur controller with the policy object looks like this class PostsController lt ApplicationController def create if PostsCreationPolicy create current user post create end endend How to use policy objects in RailsCreate a policy directory inside app policies and place all of your policy classes there When you need to call the controller you can do so directly in an action or use a before action class PostsController lt ApplicationController before action authorized only edit create update destroy def authorized unless PostsCreationPolicy create current user post render file gt public html status gt unauthorized end endend How to test policy objectsIt s simple to test the behavior in the controller require rails helper RSpec describe posts type request do describe when user is not allowed do let user not allowed create user admin false editor false let tag create tag let valid attributes attributes for post tag id tag id before do sign in user not allowed end describe GET index do it return code do diet Post create valid attributes get edit post url post expect response to have http status end end endendTesting the policy is simple too we have a lots of small methods with only one responsibility require rails helper RSpec describe PostsCreationPolicy do describe when user is not allowed do let user create user editor false admin false let user editor create user editor true email verified let tag create tag let post create post tag id tag id describe create do context when user is allowed do it creates a new post do expect described class create user editor post to eq true end end context when user is not allowed do it does not create a new post do expected described class create user post to eq false end end end more test cases endendWe test whether the object is allowed to be created in every scenario ConclusionThe policy pattern concept is small but produces big results Consider applying a policy object each time you have to deal with simple or complex permissions When it comes to testing with RSpec you don t need to use database records your policiesare purely Ruby objects and your testing will be simple and fast 2022-04-14 21:06:59
Cisco Cisco Blog CCIE Match Point: Serve it, Smash it, Win it, Love it https://blogs.cisco.com/learning/ccie-match-point-serve-it-smash-it-win-it-love-it victory 2022-04-14 21:13:22
海外科学 NYT > Science The Shakespearean Tall Tale That Shaped How We See Starlings https://www.nytimes.com/2022/04/11/science/starlings-birds-shakespeare.html The Shakespearean Tall Tale That Shaped How We See StarlingsResearchers debunked a long repeated yarn that the common birds owe their North American beginnings to a th century lover of the Bard Maybe this ubiquitous bird s story is ready for a reboot 2022-04-14 21:09:13
海外TECH WIRED Elon Musk Is Right About Twitter https://www.wired.com/story/elon-musk-right-about-twitter takeover 2022-04-14 21:17:51
ニュース BBC News - Home Russian warship Moskva has sunk - defence ministry https://www.bbc.co.uk/news/world-europe-61114843?at_medium=RSS&at_campaign=KARANGA missile 2022-04-14 21:28:09
ニュース BBC News - Home Harry and Meghan visit Queen on way to Invictus Games https://www.bbc.co.uk/news/uk-61114969?at_medium=RSS&at_campaign=KARANGA netherlands 2022-04-14 21:36:58
ニュース BBC News - Home Lyon 0-3 West Ham United (1-4 on aggregate): Hammers reach first European semi-final in 46 years https://www.bbc.co.uk/sport/football/61088177?at_medium=RSS&at_campaign=KARANGA Lyon West Ham United on aggregate Hammers reach first European semi final in yearsWest Ham will face Eintracht Frankfurt for a place in the Europa League final after securing their first European semi final in years with a stunning win in Lyon 2022-04-14 21:17:22
ニュース BBC News - Home Sunken Russian warship Moskva: What do we know? https://www.bbc.co.uk/news/world-europe-61103927?at_medium=RSS&at_campaign=KARANGA ukrainian 2022-04-14 21:06:38
ニュース BBC News - Home Rangers 3-1 Braga (3-2 agg): Kemar Roofe extra-time winners puts Scots into semi-final https://www.bbc.co.uk/sport/football/60903543?at_medium=RSS&at_campaign=KARANGA Rangers Braga agg Kemar Roofe extra time winners puts Scots into semi finalRangers are into the Europa League semi final after Kemar Roofe s extra time winner settled a pulsating tie with Braga who finished with nine men 2022-04-14 21:54:48
ニュース BBC News - Home PSV Eindhoven 1-2 Leicester (1-2 agg): Foxes reach first European semi-final https://www.bbc.co.uk/sport/football/61097331?at_medium=RSS&at_campaign=KARANGA PSV Eindhoven Leicester agg Foxes reach first European semi finalRicardo Pereira scored a late winner as Leicester City produced a superb comeback to beat PSV and reach a first European semi final 2022-04-14 21:39:09
ビジネス ダイヤモンド・オンライン - 新着記事 ロシア、飛び地への核配備示唆 北欧2カ国のNATO加盟けん制 - WSJ発 https://diamond.jp/articles/-/301703 飛び地 2022-04-15 06:09:00
北海道 北海道新聞 NY株反落、113ドル安 米金利上昇でITに売り https://www.hokkaido-np.co.jp/article/669734/ 金利上昇 2022-04-15 06:02:41
ビジネス 東洋経済オンライン 企業は値上げに「強気ではない」という分析結果 コロナ禍から脱していくと価格競争は復活する | 若者のための経済学 | 東洋経済オンライン https://toyokeizai.net/articles/-/581507?utm_source=rss&utm_medium=http&utm_campaign=link_back 価格競争 2022-04-15 06:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)